Results 1 to 4 of 4

Thread: QODBC driver

  1. #1
    Join Date
    Jun 2011
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QODBC driver

    hi everybody i write an application with qt 4.7 in windows 7 that connect to mssql 2008 on remote server .i need use this application on windows xp but when i execute exe file in windows xp it generate an error driver not loaded.in windows 7 i install sqlserver 2008 and create odbc connection and it run without error. i do'nt want in windiws xp setup qt sdk and sql server 2008.how can i run my program that can connect to mssql remote server?

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QODBC driver

    This is a "deployment" problem.

    Read here and here for details
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    Nov 2010
    Posts
    10
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QODBC driver

    When You compile and link your files using Qt Editor, Qt will create folder: C:\....\MyProject-build-desktop\debug
    Inside this folder there will be MyProject.exe file.
    You must copy into this folder some dll files.
    You can find dll files here: c:\QtSDK\Desktop\Qt\4.7.3\mingw\bin\
    Into debug folder You must copy 4 files that are needed by any Qt app. Those files are:
    1. libgcc_s_dw2-1.dll
    2. mingwm10.dll
    3. QtGuid4.dll
    4. QtCored4.dll

    I'm not quite sure about next steps because I was doing this in earlier versions of Qt, but here is how I was doing it:
    Copy this folder: c:\QtSDK\Desktop\Qt\4.7.3\mingw\plugins\sqldrivers \ into your debug folder(the folder that contains MyProject.exe file)
    Just in case copy these dll files into your debug folder:
    1. QtSqld4.dll
    2. QtSql4.dll
    (These two files location is c:\QtSDK\Desktop\Qt\4.7.3\mingw\bin\)

    Edit your .pro file by adding this code: QT += core sql

    Qt Code:
    Qt Code:
    1. QT += core gui\
    2. += core sql //THIS IS WHAT YOU NEED TO ADD
    3.  
    4. TARGET = MyProject
    5. TEMPLATE = app
    6.  
    7.  
    8. SOURCES += main.cpp\
    9. mainwindow.cpp \
    10. .
    11. .
    12. .
    To copy to clipboard, switch view to plain text mode 

    Copy your debug folder to PC without installed Qt and run MyProject.exe file. If the problem persist after that notify me, and we shall see what to do next.

  4. #4
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QODBC driver

    As a side remark, I wouldn't use the debug build on a different machine.

    Since the program starts on the other machine, I would think it has no problems with finding the QtGui and QtCore DLL's. Rather it may just be a matter of putting the plugins in the right place. You find the plugin DLLs to copy in your Qt directory \plugins\sqldrivers.

    Best regards,
    Marc

Similar Threads

  1. QSqlDatabase: QODBC driver not loaded
    By sattu in forum Qt Programming
    Replies: 1
    Last Post: 22nd January 2011, 11:40
  2. QSqlDatabase: QODBC driver not loaded
    By gutiory in forum Qt Programming
    Replies: 1
    Last Post: 14th April 2010, 09:24
  3. QODBC driver
    By martisho in forum Qt Programming
    Replies: 2
    Last Post: 7th April 2010, 19:48
  4. QODBC driver not loaded error
    By Askar in forum Qt Programming
    Replies: 0
    Last Post: 23rd October 2009, 10:35
  5. QODBC Driver
    By mchara in forum Qt Programming
    Replies: 2
    Last Post: 17th January 2008, 14:40

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.