Page 3 of 3 FirstFirst 123
Results 41 to 42 of 42

Thread: Qt and MySQL Database Connection

  1. #41
    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: Qt and MySQL Database Connection

    Quote Originally Posted by shamik View Post
    i have soved the previous problem myself. i dont know wheather what i did is right or not.
    this is what i did .
    i modified the ld.so.conf and properly set the qtdir path.
    then i ran 'ldconf' command from shell.
    Very good.

    but the error is the same as i have posted earlier. it comes with two simultneous exclamations saying: "An error occured while accessing the database"
    and then followed by that series of QSqlRecord.... (just see the previous to previous post)
    Did you make sure the connection is made before the datatable is created?

    one more thing.
    my-sql devel package has installed( i think) the files i.e. mysqlclient.so and all similar ones in folder /usr/lib/mysql

    now notice this :
    when i compile the driver with the qmake command as follows :
    qmake -o Makefile "INCLUDEPATH+=/usr/local/mysql/include" "LIBS+=-L /usr/lib/mysql -lmysqlclient" mysql.pro

    i.e. i give the library path of /usr/lib/mysql
    the driver is formed. ok. but qt as usual crashed as our previous problem and all the programs gives relocation error as previously.
    Because it's not enough to compile the driver against the proper library. The linker must be able to find the library when running the application. I already gave you some info about it earlier in this thread.

    1). i have to set qtdir path everytime i restart. how to avoid it?
    Add it to your profile (for example in /etc/profile.d/).

    2). as u were telling, how to run examples as qt3? the older version on my system is qt-3.1 and the new is qt-3.3.0.
    Well... cd to the directory where examples are ($QTDIR/examples maybe?), compile them and run them.
    3). if the preview form can show the database contents then why is the error coming of accessing the database when i run the exe?
    I don't know. Running the examples is to verify that.
    4). in ur previous post u were telling about single and multi thread. how to set those better and worse options?
    I'm sorry, this is a Qt forum, not a Linux-system-usage-howto one. Refer to your system manual for details on creating softlinks.

    The bottom line is - I can't guide you through a custom installation of MySQL on your system. I advise you to find proper RPMs to install the dbms using regular methods which will prepare your system to using the library. If you persist on doing a custom installation - you have to do it on your own (or refer to a mysql-related site).

  2. #42
    Join Date
    Sep 2006
    Posts
    102
    Thanks
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Qt and MySQL Database Connection

    hiii there

    i have solved all the problems.

    now everything is working fine.

    the reason why it was showing the database contents in preview and not while running the exe is that i had to change the place where i used to make object of the form.

    first i used to make it in the begenning of the main function. but after i changed its position, i.e. i now make the object at the end of the main function after writing all the code and before calling that object.

    it seems everything willl b alright now.
    i'll mail you if i have some other problems in qt programming.

    but thanks very very very much for helping me so far and taking interest in my problems.

    thumbs up to u.

    regards
    shamik

Similar Threads

  1. Replies: 7
    Last Post: 12th August 2006, 15:11
  2. Issues regarding QMySql drivers and mysql database
    By bera82 in forum Qt Programming
    Replies: 2
    Last Post: 10th August 2006, 17:50
  3. Connection with MySql
    By vishva in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2006, 11:58
  4. Filling combobox from database
    By Philip_Anselmo in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2006, 17:53
  5. Replies: 8
    Last Post: 7th March 2006, 13: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.