Congratulations to our 2022 Qt Champions!

QAxObject and msvc

  • Hi. I'm trying to connect to a sql server by ado using the component QAxObject and these lines of code:

    QAxObject *connection = new QAxObject("ADODB.Connection");
    connection->dynamicCall("Open(\"Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=Inaz;Data Source=SERVER02\")");
    // Execute query and get recordset
    QAxObject *recordSet = connection->querySubObject("Execute(\"select column01 from table01\")");
    // Get fields
    // or check to see what you can do with and how to use a recordset
    QAxObject *fields = recordSet->querySubObject("Fields");

    But I obtain this error:

    The example

    goes to crash.

    How can I do to resolve my problem?

  • After many tries the software works using an ado connection through odbc but not directly to a sql server.

    Have you got any idea?

Log in to reply