SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Help with File DSN please

    Hi,

    I've been using a User or System DSN for my DB connection in tests, so far and it's been working great.
    I can't create a user DSN on other machines that will be running the tests via TestExecute, so I'd like to use a File DSN, then check that into the source repository and then everyone should be able to use it; they'll all have the same drivers that are required.

    My question is - HOW do I use a File DSN in the connection after I've created it?

    var Qry, FoundCR;
    // Create a query
    Qry = ADO["CreateADOQuery"]();
    // Specify a Connection string - currently uses SystemDSN
    Qry["ConnectionString"] = "Provider=MSDASQL;Persist Security Info=False;Data Source=Recipes";
    // Specify the SQL expression - Cluster Recipe Name passed in from outside
    Qry["SQL"] = "Select max(ID) as ID from ClusterRecipes where Name = '" + CRName + "'";
    // Execute the Query
    Qry["Open"]();

    This worked fine... but adding ".dsn" onto the end of Recipes doesn't work.
    I'm not sure where the .dsn file should reside. I've put it in the scripts folder, and pointed ODBC data sources at it ... but still no joy.

    Is anyone able to help me with this? Hopefully it's something simple. The Connection Test works fine from the ODBC manager, so the dsn itself seems ok.

    It's all running on 32 bit O/S too...

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    1,049
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help with File DSN please

    Hi Jono,

    I believe the question is more related to connection strings and data providers than to TestComplete. I recommend that you try finding a connection string which allows specifying the needed DSN on the following web site:
    http://connectionstrings.com/
    Regards,
    Allen - SmartBear Support

  3. #3
    Junior Member
    Join Date
    Dec 2010
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help with File DSN please

    Thanks Allen,

    Now sorted. In case anyone is wondering, the solution was to do something like this:

    var DSN = "FILEDSN=MyFileDsn.dsn"; // MyFileDsn.dsn resides in my script folder - otherwise include the path to it e.g. =c:\MyFileDsn.dsn

    var Qry = ADO["CreateADOQuery"]();
    Qry["ConnectionString"] = DSN;
    Qry["SQL"] = "select blah blah blah from something";
    Qry["Open"]();


    But basically, I just had to point the Connection string at the DSN file... should've thought about that in the first place.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:12 AM.

Copyright BetaSoft Inc.