Share Button

If you are getting E_Fail Error Message Occurs with Access ODBC Driver and LEFT OUTER JOIN Queries then you can fix this issue by the given Process to fix bug error in ODBC driver in this article. When you submit the LEFT OUTER JOIN query to the Microsoft Access ODBC driver then you may receive “Run-time error ‘-2147467259 (80004005)’: Data provider or other service returned an E_FAIL status.” error message. This is a programmatical error that comes with ODBC driver. You will get the causes and the solution of the bug error in ODBC driver in this article. The causes of ODBC driver is given in the below paragraph.

Causes of ODBC driver error

As you know this is a programmatical error so it occurs due to an error in a program that is written you and getting an error when you are running the program. You can fix this error programmatically by the given program. The process to remove bug error in ODBC driver is given in the below paragraph.

Process to remove bug error in ODBC driver

To fix the driver problem first of all start the Microsoft visual basic 6.0 and then select a Standard EXE project and after that add the Microsoft ActiveX Data Objects 2.5 Library and Microsoft ADO Ext. 2.5 for DDL and Security preferences. And then copy the following program and paste into the load event of the default form.

Dim strSQL As String
Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
On Error Resume Next
Kill “x.mdb”
On Error GoTo 0
cat.Create “Provider=Microsoft.jet.oledb.4.0;data source=x.mdb;”
tbl.Columns.Append “cChar”, adVarWChar, 5
tbl.Columns.Append “cBool”, adBoolean
tbl.Name = “tOne”
tbl.Keys.Append “PK1”, adKeyPrimary, “cChar”
cat.Tables.Append tbl
Set tbl = Nothing
tbl.Columns.Append “cChar2”, adVarWChar, 5
tbl.Columns.Append “cChar3”, adVarWChar, 5
tbl.Name = “tTwo”
tbl.Keys.Append “PK2”, adKeyPrimary, “cChar2”
cat.Tables.Append tbl
Set tbl = Nothing
Set cat = Nothing
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.CursorLocation = adUseClient
cn.Open “Provider=MSDASQL.1;Driver={Microsoft Access Driver (*.mdb)};DBQ=x.mdb;” ‘Errors
‘cn.Open “provider=Microsoft.jet.oledb.4.0;data source=x.mdb” ‘Works
cn.Execute “INSERT INTO tOne VALUES (‘aaaaa’,0)”
cn.Execute “INSERT INTO tOne VALUES (‘bbbbb’,1)”
cn.Execute “INSERT INTO tOne VALUES (‘ccccc’,0)”
cn.Execute “INSERT INTO tTwo VALUES (‘aaaaa’,1)”
cn.Execute “INSERT INTO tTwo VALUES (‘ddddd’,1)”
cn.Execute “INSERT INTO tTwo VALUES (‘eeeee’,1)”
strSQL = “SELECT cChar2, cChar3, cChar, cBool ” & _
“FROM tOne LEFT OUTER JOIN tTwo ON tOne.cChar = tTwo.cChar2”
rs.Open strSQL, cn, adOpenStatic, adLockOptimistic, adCmdText
MsgBox rs.RecordCount ‘Errors here!

After pasting the code you have to press f5 to execute the program. When the program executed then the error that is you facing with ODBC driver becomes removed.

Share Button
BUG: E_Fail Error Message Occurs with Access ODBC Driver and LEFT OUTER JOIN Queries

Leave a Reply

Your email address will not be published. Required fields are marked *