M
Michael Russell
I've got a form that allows the user to enter the information to build a
connection string for various data connection types. I've run into a
problem testing the ODBC for a dsn-less connection, using a MS Access
database.
I fill out the minimum required information (Driver and Datasource/Dbq),
but the string would always fail to open a connection.
This is the code used:
csb.Add( "Driver", settings.Driver );
csb.Add( "Dbq", settings.DataSource );
This is an example of what the CSB would return:
Driver="{Microsoft Access Driver (*.mdb)}";Dbq=d:\work\reporter1.mdb
What I found to be the problem is the quoting around the Driver text,
which is added autmomatically by the CSB. If I remove the quotes before
using the string, then it works perfectly.
Doing some reading, I saw a reference that indicated that this quoting
is done as a security measure to prevent injection attacks. Am I using
the ConnectionStringBuilder incorrectly?
Michael
connection string for various data connection types. I've run into a
problem testing the ODBC for a dsn-less connection, using a MS Access
database.
I fill out the minimum required information (Driver and Datasource/Dbq),
but the string would always fail to open a connection.
This is the code used:
csb.Add( "Driver", settings.Driver );
csb.Add( "Dbq", settings.DataSource );
This is an example of what the CSB would return:
Driver="{Microsoft Access Driver (*.mdb)}";Dbq=d:\work\reporter1.mdb
What I found to be the problem is the quoting around the Driver text,
which is added autmomatically by the CSB. If I remove the quotes before
using the string, then it works perfectly.
Doing some reading, I saw a reference that indicated that this quoting
is done as a security measure to prevent injection attacks. Am I using
the ConnectionStringBuilder incorrectly?
Michael