SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Apr 2006
    Location
    Bangalore
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Automatic Updation Of DSN Name

    Hi All,

    Is there any way to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release?

    Thanks in Advance
    Rahi123

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Automatic Updation Of DSN Name

    You can use SetTOProperty...and place the actual connection string in an environment file...

  3. #3
    Member
    Join Date
    Apr 2006
    Location
    Bangalore
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Automatic Updation Of DSN Name

    Hi Tarun,

    Can you please elaborate the procedure [img]/images/graemlins/confused.gif[/img]

    Thanks,

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Automatic Updation Of DSN Name

    When you add the DB Checkpoint, you can go to the OR and there would be a object in OR related to that checkpoint. You can parametrize the source property to pick the value from a Environment variable/data table.

  5. #5
    Senior Member
    Join Date
    May 2004
    Location
    Lakeland, FL
    Posts
    299
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Automatic Updation Of DSN Name

    Or you can run a script to modify your registry ...

    Public Const REG_SZ = 1
    Public Const HKEY_LOCAL_MACHINE = &H80000002

    Extern.Declare micLong, "RegCreateKey", "advapi32.dll", "RegCreateKeyA", micLong, micString, micLong + micByRef
    Extern.Declare micLong, "RegSetValueEx", "advapi32.dll", "RegSetValueExA", micLong, micString, micLong, micLong, micString, micLong
    Extern.Declare micLong, "RegCloseKey", "advapi32.dll", "RegCloseKey", micLong


    Public Sub SetODBCTestDBConnn(ServerName, DataBaseName, DataSourceName, DataSourceDescription, DriverPath, LastUser)

    Dim lngResult 'As Long
    Dim lngKeyHandle 'As Long

    lngKeyHandle=CLng(lngKeyHandle)
    lngResult = Extern.RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBC.INI\" & _
    DataSourceName, lngKeyHandle)
    lngResult = Extern.RegSetValueEx(lngKeyHandle, "Database", 0, REG_SZ, _
    DataBaseName, Len(DataBaseName))
    lngResult = Extern.RegSetValueEx(lngKeyHandle, "Description", 0, REG_SZ, _
    DataSourceDescription, Len(DataSourceDescription))
    lngResult = Extern.RegSetValueEx(lngKeyHandle, "Driver", 0, REG_SZ, _
    DriverPath, Len(DriverPath))
    lngResult = Extern.RegSetValueEx(lngKeyHandle, "LastUser", 0, REG_SZ, _
    LastUser, Len(LastUser))
    lngResult = Extern.RegSetValueEx(lngKeyHandle, "Server", 0, REG_SZ, _
    ServerName, Len(ServerName))
    lngResult = Extern.RegSetValueEx(lngKeyHandle, "Trusted_Connection", 0, REG_SZ, _
    "Yes", 3)
    lngResult = Extern.RegCloseKey(lngKeyHandle)
    lngResult = Extern.RegCreateKey(HKEY_LOCAL_MACHINE, _
    "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", lngKeyHandle)
    lngResult = Extern.RegSetValueEx(lngKeyHandle, DataSourceName, 0, REG_SZ, _
    DriverName, Len(DriverName))
    lngResult = Extern.RegCloseKey(lngKeyHandle)

    End Sub
    JFry

 

 

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 10:18 AM.

Copyright BetaSoft Inc.