Hello
Im building an application with a connection to a MDB database (access).
Ive build the code like this:
But ill get an error.. .Net said that the string is not correct.
On an other part of the program i use this code:
That last part works !!
But why the first not ?
Wats wrong.. database contains the full path to the database like: c:\database.mdb
Im building an application with a connection to a MDB database (access).
Ive build the code like this:
Code:
IniFile ini = new IniFile("test.ini");
database = ini.IniReadValue("Info", "Database");
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + database + ";User Id=admin;Password=;";
SqlConnection cn = new SqlConnection(connectionString);
string sCommand = "select * from Klanten";
But ill get an error.. .Net said that the string is not correct.
On an other part of the program i use this code:
Code:
database = ini.IniReadValue("Info","Database");
connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;";
connectionString += @"Data Source=" + database + ";";
Connection.ConnectionString = connectionString;
Connection.Open();
That last part works !!
But why the first not ?
Wats wrong.. database contains the full path to the database like: c:\database.mdb