My code works fine when I use ADO controls to search through the database. However, I get an error when I try to update the database. I haven't been using ADO controls for updating, adding, or deleting, rather I use this code:
Dim conResult As New ADODB.Connection
Dim cmdResult As New ADODB.Command
conResult.mode = adModeShareDenyNone
conResult.CursorLocation = adUseClient
conResult.Provider = "Microsoft.Jet.OLEDB.4.0"
conResult.ConnectionString = "DSN=myDSN"
conResult.Open
Set cmdResult.ActiveConnection = conResult
cmdResult.CommandType = adCmdText
cmdResult.CommandText = strUpdate 'SQL Command
cmdResult.Execute
I get an error on the line that says "conResult.Open". The error says "Cannot find installable ISAM." I've tried this on several computers so I don't think it's something I missed installing Visual Studio. Also, when I replace the ConnectionString property with a connection string (the kind you build in the wizard when you select "Use Connection String" instead of a DSN, it works fine.
How can I update, add, and delete records using ODBC?? I want to use ODBC so I can connect over a network without the database path hardcoded into my code!
Oh yeah, and I'm using MS Access.
Thanks in advance for any help!!
Dim conResult As New ADODB.Connection
Dim cmdResult As New ADODB.Command
conResult.mode = adModeShareDenyNone
conResult.CursorLocation = adUseClient
conResult.Provider = "Microsoft.Jet.OLEDB.4.0"
conResult.ConnectionString = "DSN=myDSN"
conResult.Open
Set cmdResult.ActiveConnection = conResult
cmdResult.CommandType = adCmdText
cmdResult.CommandText = strUpdate 'SQL Command
cmdResult.Execute
I get an error on the line that says "conResult.Open". The error says "Cannot find installable ISAM." I've tried this on several computers so I don't think it's something I missed installing Visual Studio. Also, when I replace the ConnectionString property with a connection string (the kind you build in the wizard when you select "Use Connection String" instead of a DSN, it works fine.
How can I update, add, and delete records using ODBC?? I want to use ODBC so I can connect over a network without the database path hardcoded into my code!
Oh yeah, and I'm using MS Access.
Thanks in advance for any help!!