[freetds] Can't SQLConnect to db with dash

Fedor fedor at simplonic.com
Mon Feb 27 15:41:10 EST 2006


Hello,

I ran into a problem when trying to connect to a database with a dash (-) in
the name. If I incase the database name in single quotes it tries to connect
to it using double single quotes in the name, ie. ''test-db''.

Here's a sample error:
The database name for test purposes is test-db, connecting using isql
commandline with dsn.

[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[08004][unixODBC][FreeTDS][SQL Server]Could not locate entry in sysdatabases
for database 'test'. No entry found with that name. Make sure that the name
is entered correctly.
[][unixODBC][FreeTDS][SQL Server]Changed database context to 'test-db'.
[ISQL]ERROR: Could not SQLConnect

Config:

Driver  = FreeTDS
Description     = TestDSN
Trace   = No
Server      = 192.168.1.1
Port      = 1433
Database        =test-db

Looks like there's a command line function being used to connect and it uses
the dash for parameters/options and I've tried incasing the name various
ways and it's just not working. I can connect fine to databases without
dashes, and renaming is not an option at this point since there are
systems/apps already using the databases with dashes, it would be the last
resort.

Thanks.



More information about the FreeTDS mailing list