Auto mail Merge with SQl 2000

P

Peter Newman

Im trying to automate some of the word documents by linking them up to a SQL server

Im fairly new to word visualbasic so would appricate any assistance, a simple secnario is that a user calls a word document from a visual basic 6 application and parms a Client reference number to it. Word uses that ClientReference to select the address details from a SQl quer

for the purpose of this example,
SQL200
Server Name = MYSERVE
Server Logon Name = TestUse
Server Logon Password = TestPasswor


sqlQuery = Select Name, Postcode from Table1 where ClientNo = @ClientReferenc

anyhelp or examples would be very helpful
 
B

Birgit

Hi Peter,
have a look at the following article: It uses ADO to get data from SQL
server
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdmthgetrowsx.asp

In order to use ADO from Word you have to add a reference to Microsoft
ActiveX DataObjects to your template.

Post back if you run into problems.

If you are running Office 97 you have to use ODBC, I believe. Even though I
have connected into SQLserver from Access 97, I have never done it from
Word. I have, however, used the above method to get data from Access2000 to
Word2000 and it worked like a charm once I had figured out the issue of
connect strings.

Cheers,
Birgit

Peter Newman said:
Im trying to automate some of the word documents by linking them up to a SQL server .

Im fairly new to word visualbasic so would appricate any assistance, a
simple secnario is that a user calls a word document from a visual basic 6
application and parms a Client reference number to it. Word uses that
ClientReference to select the address details from a SQl query
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top