[Interest] [Qt-interest] important:qt connect mssql on linux

Jordi Pujol pisoengracia at gmail.com
Mon Oct 15 12:03:48 CEST 2012


Hi Ken,

The message is clear : ODBC driver manager cannot find a data source
name called "sql server" anywhere.

It's not a Qt-related problem. Do you have any TDS driver installed ?
Its name is sql server ?

Take a look at odbcinst.ini, wherever its placed in your system, and
ensure that a section with the EXACT name [sql server] exists. Else, you
have to install some SQL server driver( i.e. take a look at FreeTDS ).

	Jordi.

> Hi list,
> 
>          I have compiled libqsqlodbc.so on redhat64bit successfully. 
> 
> When I run the snippets bellow some error message occurred.
> 
>  
> 
> QString Dsn = QString::fromLocal8Bit("Driver={sql
> server};server=172.2.2.2;database=Live;uid=an;pwd=an;");
> 
> QSqlDatabase::addDatabase("QODBC");
> 
>  
> 
> Error msg:
> 
> QSqlError(0, "QODBC3: Unable to connect", "[unixODBC][Driver
> Manager]Data source name not found, and no default driver specified")
> 
>  
> 
> But I found QODBC is available driver:
> 
> "QSQLITE" 
> 
> "QMYSQL3" 
> 
> "QMYSQL" 
> 
> "QODBC3" 
> 
> "QODBC" 
> 
>  
> 
> Could anybody tell me why?
> 
> 1. I found /etc/odbc.ini is empty, and /home/dd/.odbc.ini does not
> exist. Is this clue useful?
> 
>  
> 
> Thanks a lot
> 
> Ken






More information about the Interest mailing list