Hello,
I'm trying to create a recordset in vb from data stored in an Excel spreadsheet. I've defined an ODBC DSN to the spreadsheet. I've used to following code in VB to try and set up the recordset:
With rs_TAIBCITY
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.ActiveConnection = cn_TAIBCITY
.Open "select * from TAIBCITY"
End With
In the past I've been able to run SQL queries on Excel files if I select the columns of interest in Excel and do an insert/name, and give it a name (This name then acts as the table name for the SQL statement.
However, given all this, I still get an error stating that:
Runtime error '3001'
Arguments are of wrong type, are out of acceptable range, or are in conflict with one another.
Any help would be much appreciated.
-John
I'm trying to create a recordset in vb from data stored in an Excel spreadsheet. I've defined an ODBC DSN to the spreadsheet. I've used to following code in VB to try and set up the recordset:
With rs_TAIBCITY
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.ActiveConnection = cn_TAIBCITY
.Open "select * from TAIBCITY"
End With
In the past I've been able to run SQL queries on Excel files if I select the columns of interest in Excel and do an insert/name, and give it a name (This name then acts as the table name for the SQL statement.
However, given all this, I still get an error stating that:
Runtime error '3001'
Arguments are of wrong type, are out of acceptable range, or are in conflict with one another.
Any help would be much appreciated.
-John