issue a parameterized SQL statement to odbc excel data source
Posted on 2003-03-24
I need to access an excel data file via odbc using ado, and furthermore I need to issue a parameterized SQL statement in my vb code, like:
1 mycnn as adodb.connection
2 mycmd as adodb.command
... 'codes for connect to data source and assign it to mycmd
3 mycmd.commandText = "select * from mytable where col1 = ? or col2 = ?"
... 'codes for append necessary parameters to mycmd.parameters collection
I got error message at line 4, like:
-2147217887:[Microsoft][ODBC Excel Driver]Invalid precision value
I've tried but failed to find enough helpful document about this and I'm wondering if MS supports this kind of feature for excel driver, or am I just not on the right road?
Need your help!