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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook ADO

Status
Not open for further replies.

vbajock

Programmer
Jun 8, 2001
1,921
US
I am trying to establish an ADO connection to a local Access 2000 database, using VB script in Outlook like so:

Sub CmdTest_click()
set adoCnn = application.createobject("ADODB.Connection")
dbname="d:\barcode\db6.mdb"

adocnn.open "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & dbname

if adocnn.state <> adstateopen then
msgbox &quot;cnn Fail&quot;
else
msgbox &quot;cnn ok&quot;
end if

end sub

It always fails. Can anyone see what I am doing wrong?
I am not much of a Vb Script person - I am a little confused by the fact that there is no place to reference a library. Am I supposed to be embedding an ADO control somewhere on the form to make this work ?







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top