SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Guest

    DB_Connect without a DSN

    I need to run the same silk script on different machines. for this I have to setup ODBC connection from the control panel in each machine. Is there anyway that I avoid using DSN and instead supply all the attributes needed for the connection in the script itself so I dont need to create ODBC on each computer.

    ------------------

  2. #2
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_Connect without a DSN

    You must have a DSN on the computer, but you can have the script set it up for you like this....


    [ ] INTEGER iKey = HKEY_LOCAL_MACHINE
    [ ] STRING sPath = "SOFTWARE\ODBC\ODBC.INI\Creating"
    [ ] STRING sItem = "DBQ"
    [ ] SYS_SetRegistryValue (iKey, sPath, sItem, "{sDBQ}")
    [+] while (SYS_GetRegistryValue (iKey, sPath, sItem) != sDBQ)
    [ ] sleep (5)// sometimes takes a few seconds for the registry to update.


    The only caveat to the above is that the ODBC drivers need to be present on the machine that this is installing a DSN to.



    ------------------
    James Soderborg
    http://www.ameliortech.com
    jamesso@ameliortech.com

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_Connect without a DSN

    If you are running silktest scripts on many different target machines, but from only one host machine, then there is no problem here; the DBTester functionality works from the host machine, not the target machine, so you only need to set up your odbc datasources on the one machine.

    If you have many host machines to which you want to copy the same odbc datasources, you can do it fairly quickly using a registry file; using regedit, export a registry file from the key HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
    and import it into any other host machine you are using.
    Notice that this will only work successfully if all the file locations (e.g. of the odbc driver dlls in C:\winnt\system32\) are the same on all the machines you want to copy the registry key to.

    ------------------

  4. #4
    Senior Member
    Join Date
    Dec 1999
    Location
    Sarasota FL USA
    Posts
    109
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: DB_Connect without a DSN

    Use the systems control panel to create a File DSN type of ODBC connection. The file is in a normal INI file format. In your script, create a function that will create this file on the fly. The next thing to change is the connection in the DB_Connect to reference the file.

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 02:22 PM.

Copyright BetaSoft Inc.