I am maintaining some legacy classic ASP code through a hardware move. The code queries a local Access database. On the old system, the database connection was opened as follows:
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='path to mdb file';"
Rather than cajole the old Jet driver onto the new system, I hoped to simply update the connection string to:
"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=path to file;"
This new connection string breaks any queries that have string values surrounded by double-quotes. For example, this query works with the old Microsoft.Jet.OLEDB.4.0 driver but errors with the new one:
conn.Execute("UPDATE table SET field1=1 WHERE field2=""test"";")
Replacing double-quotes with single-quotes fixes individual queries, i.e. this works with both drivers, but would be a big refactoring job and likely to introduce bugs into trusted code:
conn.Execute("UPDATE table SET field1=1 WHERE field2='test';")
I am seeking a way to have the Microsoft Access Driver (*.mdb) use the existing queries (that have strings surrounded by double quotes) without refactoring them. Thanks in advance.