Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word to Oracle Connection ????

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
US
Does anyone know howto make a connection to an oracle database to extract records into a word doc through VB.
I just need help with the connection. This one (below) works for MS Access but I need to connect to oracle hopefully without a DSN but can use it if I have too.
Thanks in advance

Dash

With ActiveDocument.MailMerge
.MainDocumentType = wdFormLetters
constr = "DSN=MS Access Databases;" _
& "DBQ=C:\Access\NorthWind.mdb;" _
& "FIL=RedISAM;"
.OpenDataSource Name:="C:\MSOffice\Access\NorthWind.mdb", _
Connection:=constr, SQLStatement:="SELECT * FROM Customers"
End With

 
Disregard I finally figured it out. Thanks anyway

With WrdDoc.MailMerge
.MainDocumentType = wdMailingLabels
CONSTR = "DSN=X9; PWD=mypasswordt"
.OpenDataSource Name:=X9, Connection:=CONSTR, SqlStatement:="Select FIRST_NAME FROM CUST WHERE LAST_NAME ='THELASTNAME'"
End With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top