Results 1 to 2 of 2

Thread: QTDS - SQLServer 2000 - Win strange behaviour

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTDS - SQLServer 2000 - Win strange behaviour

    I've had a problem. I presumed was my mistake, as usual . But after some investigation I think I've found a Qt-bug. Anybody can test this code in a Win-xx environment to confirm my suspects ?

    Environment : mingw32 3.4.2, SQLServer 2000-SP4, Qt 4.3.0, driver QTDS

    Qt Code:
    1. #include <QApplication>
    2. #include <QtSql/QSqlDatabase>
    3. #include <QtSql/QSqlQuery>
    4. #include <QtSql/QSqlRecord>
    5. #include <QVariant>
    6. #include <fstream>
    7.  
    8. using namespace std;
    9.  
    10. int main(int argc, char *argv[])
    11. {
    12. ofstream DEBUG;
    13. DEBUG.open ( "LOG.TXT" );
    14.  
    15. QCoreApplication app(argc, argv);
    16.  
    17. QSqlDatabase db = QSqlDatabase::addDatabase ( "QTDS" );
    18. db.setHostName ( "<HOSTNAME>" );
    19. db.setDatabaseName ( "<DATABASE>" );
    20. db.setUserName ( "sa" );
    21. db.setPassword ( "<pwd>" );
    22. db.open();
    23.  
    24. QSqlQuery QRY ( db );
    25. // here you MUST put a query that select at least a field longer than 255 chars
    26. // ( 300 , 500 , 800, ... )
    27. QString SEL = "SELECT FIELD_LONGER_THAN_255_CHAR FROM TABLE";
    28.  
    29. QRY.exec ( SEL );
    30. QRY.last();
    31. QRY.first();
    32.  
    33. while ( QRY.isValid() )
    34. {
    35. DEBUG << (const char *)QRY.record().value ( 0 ).toString().toAscii() << "\n";
    36. QRY.next();
    37. }
    38.  
    39. DEBUG.close();
    40. return 0;
    41. }
    To copy to clipboard, switch view to plain text mode 

    In windows, when the field is longer than 255 chars ( SQL analizer from Microsoft returs all the data ) the value returned from Qt's classes is "cutted" to 255 chars.

    VERY Strange....

  2. #2
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Re: QTDS - SQLServer 2000 - Win strange behaviour

    Hi all,

    Nobody uses this combination ( mingw - SQLServer - Win32 ) ??

    I'm f...ed....

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
  •  
Qt is a trademark of The Qt Company.