You are here: Sql Problem « MsSQL Server « IT news, forums, messages
Sql Problem

Posted by David on 07/23/05 00:24

I want to loop through a table (tblrelmanager) and merge the results with a

> word doc. The trouble is I am not used to SQL coding and I cant get my
> WHERE

> statement to work.

> Can anyone tell me where I am going wrong

>

> Thanks in advance

> Dave

>

>

>

>

>

> Set rst = db.OpenRecordset("tblrelmanager")

>

> Do Until rst.EOF

>

> Set objWord = GetObject("N:\Customer Management Centre\Warrington\Reach

> Team\Database\fire risk assessment.doc", "Word.Document")

> objWord.Application.Visible = True

> objWord.MailMerge.OpenDataSource _

> Name:="D:\Documents and Settings\All Users\Documents\WSS\WSS.mdb", _

> LinkToSource:=True, _

> Connection:="table tblAccenture", _

> SQLStatement:="SELECT * FROM [tblAccenture] WHERE [Relationship

> Manager] = rst.[Relationship Manager]"

>

> objWord.MailMerge.Execute

> rst.MoveNext

> Loop

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация