Results 1 to 5 of 5

Thread: DB_Connect

  1. #1


    I am having a hard time connecting to my database through Winrunner 7.0.

    What are all the possible parameters in the connection string?

  2. #2
    SQA Knight
    Join Date
    Jun 2002
    Cupertino, CA, USA

    Re: DB_Connect

    The steps for connecting to any database are the same.

    1) Create an ODBC connection (also called a DSN - data source name) to the database.

    For this you will need an ODBC driver. For microsoft databases (Access and SQL Server), the ODBC driver is usually included in the operating system. For other types of databases, you will need to install the client software.

    2) Insert the db_connect function from the function generator.

    a) Create->Insert Function->From Function Generator
    b) Select db_connect
    c) Press the Args>> button
    d) Next to Connec Str, pres the ... button
    e) The select data source dialog appears
    f) Select the data source created in step 1
    g) enter your username and password
    f) the connect string is generated for you!
    g) press the paste button to paste the function in your script!

  3. #3

    Re: DB_Connect

    bpolitzer..... u r answer is simply superb....

  4. #4
    Moderator JakeBrake's Avatar
    Join Date
    Dec 2000
    St. Louis - Year 2025

    Re: DB_Connect

    One could always put this line in a .bat file (in a protected common area) and call the bat file via dos_system(); from a WR init script:

    odbcconf /A {CONFIGSYSDSN "Microsoft Access Driver (*.mdb)" DSN=MyDSN;DBQ=C:\MyDBPath\MyDB.mdb}

    (Add other args as necessary, such as UID, PWD)

    This can be run even if the ODBC connection is already setup. It simply "refreshes" the existing one by the same name. The syntax will vary slightly by database type - Oracle, Access, etc.

  5. #5

    Re: DB_Connect

    Thanks for all the help, I got it linked up.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 07:39 PM.

Copyright BetaSoft Inc.