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 "cnn Fail"
else
msgbox "cnn ok"
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 ?
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 "cnn Fail"
else
msgbox "cnn ok"
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 ?