PDA

View Full Version : remote ODBC data source



mchara
6th December 2007, 15:24
Hi, Odbc driver allows to specify host name and data source name...
When typing ip of own machine, localhost, or leaving host name blank, everything works fine and QSqlDatabase connects to odbc's datasource, but when trying to connect to odbc datasources on another machine, QSqlDatabase can't establish connection.

Is it something with security settings on winXp?
or have you ant other ideas?

wysota
7th December 2007, 13:59
Yes, probably the firewall blocks access.

mchara
7th December 2007, 14:21
I think the reason is different, because firewalls are turned off on both machines and they are in local network so there's no firewalls between...
I rather suppose some stopped services are required, but i don't want to turn on everything without knowledge what those services do.

Or qt ignores hostName in odbc driver... it can be part of common interface for dBase drivers, but ignored by ODBC driver's implementation.

wysota
7th December 2007, 17:22
I think the reason is different, because firewalls are turned off on both machines and they are in local network so there's no firewalls between...
What about the Windows firewall present in systems from WinXP SP2 upwards?

nashman
10th December 2007, 02:23
I think the reason is different, because firewalls are turned off on both machines and they are in local network so there's no firewalls between...
I rather suppose some stopped services are required, but i don't want to turn on everything without knowledge what those services do.

Or qt ignores hostName in odbc driver... it can be part of common interface for dBase drivers, but ignored by ODBC driver's implementation.

Is dBase the type of database you are attempting to connect to? Which/whose ODBC driver are you using?

mchara
10th December 2007, 08:10
I've tried for access, excel and msSql, everything works fine for datasources defined locally, but ODBC driver reports error when trying to use datasource defined at remote machine. We have to PCs with identical databases defined and tried to connect to them in both directions.

Windows firewall is also turned of in every machine because we are using VNC software in company and it can't work with firewall.

mm78
10th December 2007, 11:34
What do you mean with "datasource defined at remote machine"?

The ODBC driver ignores host name and port and relies only on the datasources defined on the host machine. The datasource can point to a remote database of course.

You may be able to work around this by passing an ODBC connection string as database name, e.g.:
DRIVER={SQL Native Client};SERVER=SERVERNAME\INSTANCENAME;

mchara
10th December 2007, 11:39
So, it's simply impossible to connect to data source not defined on host...

As i tough at the beginning
qt ignores hostName in odbc driver - it's part of common interface for dBase drivers used by other drivers.

I'm quite sure now, thanks!