I have a simple VB6 form with:
References:
-Visual Basic for Applications
-Visual Basic runtime objects and procedures
-Visual Basic objects and procedures
-Microsoft ActiveX Data Objects 2.5 Library
and Components:
-Microsoft ADO Data Control 6.0 (OLEDB)
There is only 1 ado and 1 label in the VB6 form with this code
ado.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=mydb.mdb;Jet OLEDB:Database Password=xxx;"
lblConn.Caption = "Connection Valid"
ado.RecordSource = "SELECT * FROM Employee ORDER BY LName,FName"
'ado.RecordSource = "SELECT * FROM Employee"
ado.Refresh
The connection initializes properly, BUT the ado gives an error:
-unknown
AND
-Run-time error '-2147217900(80040e14)': Automation error
now, this works great in a different machine, but not in the one that
the new software was installed. The problem is that we are not sure
when the software was installed (or uninstalled), or what software
was, and since other software needed is newly there, we would like to
avoid usng Windows restore
to add weirdness, if you use
ado.RecordSource = "SELECT * FROM Employee"
instead of
ado.RecordSource = "SELECT * FROM Employee ORDER BY LName,FName"
It works!!!
There is a LName and FName field in the table. I also tried removing
the ORDER BY, and trying with a few WHERE ... statements and it also
gives the same error, the only time it works is when only the "SELECT
* FROM Employee" is used
I have been reaserching this issue for a few days and no luck so far.
Any tip, idea, comment, or suggestion would be GREATLY appreciated
Many thanks in advance
I found the solution, has to with a missing MS Access driver. For
future reference see
http://support.microsoft.com/?id=317708
Hope this helps people with similar issues in the future