incagold
Programmer
- Mar 21, 2003
- 54
Hi guys,
Another newbie question. We are trying to use ADO to link
to an ODBC database. We are new to both VB and ADO and just can't seem to get this to work. This is the code we have created. When we run it we get the following error at the conn.Open... line:
Run-time error '91':
Object variable or With block variable not set
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim i As Integer
conn.Open "DSN=SMV;" & _
"UID=georger;" & _
"PWD=C1701"
Set rs = conn.Execute("SELECT * FROM BUYER")
We have looked through several reference books but can't seem to find a resolution. Any suggestions you may be able to provide would be sincerely appreciated.
Thank you very much in advance,
REF
Another newbie question. We are trying to use ADO to link
to an ODBC database. We are new to both VB and ADO and just can't seem to get this to work. This is the code we have created. When we run it we get the following error at the conn.Open... line:
Run-time error '91':
Object variable or With block variable not set
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim i As Integer
conn.Open "DSN=SMV;" & _
"UID=georger;" & _
"PWD=C1701"
Set rs = conn.Execute("SELECT * FROM BUYER")
We have looked through several reference books but can't seem to find a resolution. Any suggestions you may be able to provide would be sincerely appreciated.
Thank you very much in advance,
REF