[Wine] builtin odbc32 connection does not strip { } chars from client specified driver name

Adam Gibson agibson at ptm.com
Tue Nov 15 09:04:23 CST 2005

I finally figured out why my ODBC connections would fail even though I 
was following the directions on every odbc32 wine help site that I could 

Some client apps specify the SQL connection string with { } chars 
surrounding the driver name.  Windows strips those when matching an ODBC 
driver so the {SQL Server} driver name specified by the client would 
match   SQL Server   .  Because I could not change the application I 
changed the odbcinst.ini and DSNs in odbc.ini to reference a driver 
called {SQL Server} and then the connection worked.  If anyone knows the 
odbc32 code that sounds like it would be an easy thing to filter out 
when the client specifies { } chars inside a connection string.

Put simpley... On a real Windows2000 system the connection string with 
{SQL Server} matches a driver called   SQL Server  .   In wine it will not.

---- Failure driver is SQL Server, client requesting {SQL Server} ----
0009:Call advapi32.RegQueryValueExA(00000080,7fcbeec0 "SQL 
Server",00000000,00000000,00000000,00000000) ret=4ca61cbc
... cut ...
0009:Call odbc32.SQLDriverConnect(7d2d1760,00010024,7e36163c 
"",000000ff,7fcbf6cc "<\x136~\x03",00000003) ret=236756c9

0009:Ret  odbc32.SQLDriverConnect() retval=ffffffff ret=236756c9
0009:Call odbc32.SQLError(7d2cbe90,7d2d1760,00000000,7fcbf4f4 
"",7fcbf508,7fcbf2a0 "",000001ff,7fcbf4ea) ret=23675188
0009:Ret  odbc32.SQLError() retval=00000000 ret=23675188
0009:Call odbc32.SQLError(7d2cbe90,7d2d1760,00000000,7fcbf4f4 
"IM002",7fcbf508,7fcbf2a0 "[unixODBC][Driver Manager]Data source name 
not found, and no default driver specified",000001ff,7fcbf4ea) ret=23675188
---- END ----

---- Success driver is {SQL Server}, client requesting {SQL Server} ----
0009:Call advapi32.RegQueryValueExA(00000080,7fcbeec0 "{SQL 
Server}",00000000,00000000,00000000,00000000) ret=2150bcbc
... cut ...
0009:Call odbc32.SQLDriverConnect(7c74a770,00010024,7e36163c 
"",000000ff,7fcbf6cc "<\x136~\x03",00000003) ret=236756c9
0009:Ret  odbc32.SQLDriverConnect() retval=00000000 ret=236756c9
---- END ----

The app still doesnt quite work yet but I am getting closer.  It starts 
up at least now.

More information about the wine-users mailing list