Results 1 to 9 of 9

Thread: QDataBrowser and QSqlCursor

  1. #1
    Join Date
    Sep 2006
    Location
    Rio de Janeiro, Brazil
    Posts
    44
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default QDataBrowser and QSqlCursor

    Hello,

    Is there anyway to use one QSqlCursor with more than one table?

    For instance:

    I am interested in displaying the query results obtained from ten tables.

    Any suggestions would be welcome.

    Ederson de Moura.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDataBrowser and QSqlCursor


  3. #3
    Join Date
    Sep 2006
    Location
    Rio de Janeiro, Brazil
    Posts
    44
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QDataBrowser and QSqlCursor

    Humm, to effect inserts using QDataBrowser and QSqlForm.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDataBrowser and QSqlCursor

    Quote Originally Posted by ederbs View Post
    Humm, to effect inserts using QDataBrowser and QSqlForm.
    Then maybe you could use a view? Does your database supports view updates?

  5. #5
    Join Date
    Sep 2006
    Location
    Rio de Janeiro, Brazil
    Posts
    44
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Unhappy Re: QDataBrowser and QSqlCursor

    I cannot use view.

    Form looks at mine, each QLineEdit is in different tables, the QComboBox is research.

    http://200.193.29.195/qt/form.png

    The Sql passed for the DBA.

    http://200.193.29.195/qt/sql.html

    some hope for this.

    Ederson de Moura

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

    Angry Re: QDataBrowser and QSqlCursor

    Hi,

    I am with the same problem and not meeting the solution.

    Cris.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDataBrowser and QSqlCursor

    You could create a separate QSqlForm for each table.

  8. #8
    Join Date
    Sep 2006
    Location
    Rio de Janeiro, Brazil
    Posts
    44
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QDataBrowser and QSqlCursor

    I could also make this for transactions?

    Something as:

    QSqlDatabase::database()->transaction();
    QSqlQuery query;

    query.exec("INSERT INTO bairros (id_cidade, nm_bairro)"
    "VALUES (" + Usuario + ", 8105) " );

    QSqlDatabase::database()->commit();

    Ederson de Moura

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDataBrowser and QSqlCursor

    Quote Originally Posted by ederbs View Post
    I could also make this for transactions?
    You start transaction for the whole connection, so if every QSqlForm or QSqlCursor instance uses the same connection, it will operate within the same transaction.

Similar Threads

  1. Using QDataBrowser
    By Lebowski in forum Newbie
    Replies: 10
    Last Post: 4th May 2006, 15:56

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.