Connection to the SQL SSMS database using LoadRunner

Hey,

I am trying to record traffic from SMSS application in LoadRunner, after setting the recording option the application correctly records SSMS startup but does not see the queries running, when I finish recording I get the following code in the application :

    lrd_init(&InitInfo, DBTypeVersion);
    lrd_open_context(&Ctx1, LRD_DBTYPE_ODBC, 0, 0, 0);
    lrd_db_option(Ctx1, OT_ODBC_OV_ODBC3, 0, 0);
    lrd_open_context(&Ctx2, LRD_DBTYPE_ODBC, 0, 0, 0);
    lrd_db_option(Ctx2, OT_ODBC_OV_ODBC3, 0, 0);
    lrd_close_context(&Ctx2, 0, 0);
    lrd_open_context(&Ctx3, LRD_DBTYPE_ODBC, 0, 0, 0);
    lrd_db_option(Ctx3, OT_ODBC_OV_ODBC3, 0, 0);
    lrd_close_context(&Ctx3, 0, 0);
    return 0;

What do I still need to do on my side to correctly record the execution of the query?

And question number two, how with the code I could connect to the database, what should the connection string look like correctly, I am using SSMS version 19 and LoadRunner 2023 R1 build 251.

Tags:

  • 0  

    Hi   I,ve no experience with SSMS recording, but I know that there are three possible communication protocols. You might try to limit all protocols to only TCP or one of the other protocols.

    How to ask questions

    Reward contributions via likes or 'verified answers'

  • 0

    I haven't done SSMS recording so cannot help you with that.  But regarding your second question, you should be able to use any valid connection string. This is a sample I use to pull data from SQL Server:

     

    lr_db_connect("StepName=DatabaseConnection",

        "ConnectionString=DataSource=*serverInstance*;Initial Catalog=*database*;Trusted_Connection=yes;",

        "ConnectionName=testDatabaseConnection",

        "ConnectionType=SQL",

        LAST );