Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hey everybody,
i finished developing a .Net program to my company that extract emails from our support address. anywhere, one of the first action in the code is to connect to ms access 1997 database and retrive the popHost, the UserName and so...
the code works great when i run it local on my computer. the problem accure when i try to run it on the server. after some debug, i find out that the problem is in the connection string. to make my self clear, the server has no access environment other than .Net and Jet.
Here is the Err that jumps:

"the microsoft jet oledb 4.0 provider is not registered on local machine"
"object reference not set to an instance of an object"
"unable to cast object of type 'system.nullreferenceexception' to type 'system.data.oledb.oledbException'"


the problem, as i see it, is probably at the Jet Provider. i tried 3.51, 4.0 and 12.0 and still getting those Err.
Here is my relevent Code:
VB
Dim pathX As String = My.Application.Info.DirectoryPath & "\Local.mdb"
Dim conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathX & ";Persist Security Info=True;Jet OLEDB:Database Password=" & PwdID)
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM HagEmailSupport", Conn)
conn.Open()

the Exception jump in the "conn.open" Line.
thenk you very much Ahead...
Oron.
Posted
Updated 31-Aug-14 23:22pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900