Results 1 to 8 of 8

Thread: remote ODBC data source

  1. #1
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default remote ODBC data source

    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?
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: remote ODBC data source

    Yes, probably the firewall blocks access.

  3. #3
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: remote ODBC data source

    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.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: remote ODBC data source

    Quote Originally Posted by mchara View Post
    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?

  5. #5
    Join Date
    Dec 2007
    Posts
    1
    Platforms
    MacOS X

    Default Re: remote ODBC data source

    Quote Originally Posted by mchara View Post
    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?

  6. #6
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: remote ODBC data source

    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.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  7. #7
    Join Date
    Oct 2006
    Posts
    42
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: remote ODBC data source

    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;

  8. The following user says thank you to mm78 for this useful post:

    mchara (10th December 2007)

  9. #8
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: remote ODBC data source

    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!
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

Similar Threads

  1. Connecting to an ODBC Data Source
    By kikapu in forum Newbie
    Replies: 9
    Last Post: 25th June 2007, 12:18
  2. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.