Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLEDB Connection Cannot Connect

Status
Not open for further replies.

JeffSabat

Programmer
Sep 15, 2003
32
PH
Imports System.Data.OleDb
Imports System.Data
Public Class clsDataAccess
Inherits ServicedComponent

Private Shared gstrConnectionString As String
Private mobjConnAccess As OleDbConnection

Public Function DARetrieve(ByVal SqlCmdTxt As String) As DataSet
Dim objDataSet As DataSet
Dim adpOLEDB As new OleDbDataAdapter

If DAConnect() Then
Try
objDataSet = New DataSet
adpOLEDB.SelectCommand = New OleDbCommand(SqlCmdTxt, mobjConnAccess)
adpOLEDB.Fill(objDataSet)
Return objDataSet
Catch ex As Exception
Throw ex
Finally
DAClose()
End Try
End If
End Function

Public Function DAConnect() As Boolean
Try
mobjConnAccess = New OleDbConnection(gstrProduction_ConnectionString)
mobjConnAccess.Open()

Return True
Catch ex As Exception
Throw ex
End Try
End Function
end Class

' I get an error at line 'mobjConnAccess.Open()
The error is "No error information available: E_NOINTERFACE(0x80004002)."
Why? please HElp..
the value of my gstrProduction_ConnectionString is
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Petronell Back-up\Petronell-TempAcc\Petronell.mdb;Persist Security Info=False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top