How to connect MS Word to MS SQL Server 2000 using ADO

B

Bon

Hello all

I want to connect MS Word 2000 to SQL database. After the connection is
established, MS Word will get data from the database and then add them
in the active document. Do I need to create System Data Sournce under
Control Panel -> Administration Tool -> Data Source (ODBC)?

I can't find any resources about using ADO from MS Word.

Can anyone give me some advices?

Thanks
Bon
 
P

Perry

Try something like below connection example, substituting the "My"
parameters.

Dim cn As new adodb.connection
cn.connectionstring = _
"Provider=sqloledb;sata source=" & _
MyTarget & ";Initial Catalog=pubs;User Id=" & _
MySQLLoginID & ";Password=" & _
MyPassword & ";"
cn.open

-------------------------------------
Krgrds,
Perry

System parameters:
POS: WinXP x64
MSO: MSOffice System
DEV: VS7 (dotnet)
 

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