Why does the code below generate the following error when the WHERE clause is based on a numeric field?
Run-time error '-2147217900 (80040e14)':
Internal OLE Automation error
If I change the WHERE to a text field, then the code works fine. I've tried Access 2000, 2003, and 2007 database types. I've also tried a DSN connection. It makes no difference. If the WEHRE clause is based on a numeric field it fail every time. This used to work.
Dim adoCon As ADODB.Connection, adoRec As ADODB.Recordset
Set adoCon = CreateObject("ADODB.Connection")
adoCon.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\eeTesting\Database4.accdb;Persist Security Info=False;"
Set adoRec = adoCon.Execute("SELECT * FROM Table1 WHERE SomeNumberField=10")
Set adoRec = Nothing
Set adoCon = Nothing