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

DSN

Status
Not open for further replies.

JDU

Technical User
Dec 23, 2002
182
US
I am very naive at this. I have created a DSN and want to use it to update a table residing on the other machine. This is the code that I am using. It gives me the error object variable or with block variable not found.

This is the code:

Private Sub Test()

Dim rs As Recordset
Dim cn As New Connection
cn.Open "DSN=Testing;"

rs.Open "Insert_Errors", cn

rs.AddNew
rs!Name = "John Doe"
rs.Update

End Sub

Thanks.
 
Have tried to replace this:
Dim rs As Recordset
Dim cn As New Connection
By this ?
Dim rs As ADODB.Recordset
Dim cn As New ADODB.Connection
You may have to reference the Microsoft ActiveX Data Objects 2.x Library.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top