M
micahl98 via DotNetMonster.com
Hopefully someone here can help me out, I have been beating my head against
this for 2 days.
For some reason I am unable to make a connection to an access database. I
have not had any similar problems connecting to mssql. Here is my code
striped out of its classes:
----------
var mdbConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\foobar\\
be_be.mdb;";
var objConnection : OleDbConnection;
objConnection = new OleDbConnection(connectionStr);
objConnection.Open();
----------
Theres not much to this as you can see... but I am receiving the following
error:
"System.NullReferenceException occured in system.data.dll, Object reference
not set to instance of Object..."
I assume this is because objConnection.Open() isnt working, and when I later
try to call ExecuteReader() from a Command Object theres no valid connection
in place and then it errors-out
Searching high and low for answers I thought it may be a permisson issue, so
I set the actual mdb and the folder its in to have full access via Everyone
(im using windows xp btw), but this didnt change anything.
This should be easy, but I am completely stuck... all help greatly
appreciated. -micah
this for 2 days.
For some reason I am unable to make a connection to an access database. I
have not had any similar problems connecting to mssql. Here is my code
striped out of its classes:
----------
var mdbConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\foobar\\
be_be.mdb;";
var objConnection : OleDbConnection;
objConnection = new OleDbConnection(connectionStr);
objConnection.Open();
----------
Theres not much to this as you can see... but I am receiving the following
error:
"System.NullReferenceException occured in system.data.dll, Object reference
not set to instance of Object..."
I assume this is because objConnection.Open() isnt working, and when I later
try to call ExecuteReader() from a Command Object theres no valid connection
in place and then it errors-out
Searching high and low for answers I thought it may be a permisson issue, so
I set the actual mdb and the folder its in to have full access via Everyone
(im using windows xp btw), but this didnt change anything.
This should be easy, but I am completely stuck... all help greatly
appreciated. -micah