SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Member
    Join Date
    Dec 2002
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Automating creation of DSN

    Is there any way to automate the creation of DSN (ODBC)?

    I really appreciate your help.

    Thanks,

    ------------------
    DJ
    DJ

  2. #2
    Member
    Join Date
    Sep 2001
    Posts
    69
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating creation of DSN

    There's a couple of ways not sure what your specific situation is but here are the two I can think of.

    1.) Record all the OBDC dialongs and have Silk automate the process.

    2.) Use the win32 api ODBC function calls. A while ago I used functions like createDsn() that created the entries without having to go through all the ODBC dialogs.



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

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

    Re: Automating creation of DSN

    Not sure if this is what you are asking for:

    we has a set of File DSN that were created and placed on a server that all systems have access to. This way we do not have to use worry about automating the ODBC process or working with the API.
    We created DSN files and then edit them as needed for the test we are running.

    A sample DSN File for SQL server:
    [ODBC]
    DRIVER=SQL Server
    Address={ServerName},1433
    SERVER={ServerName}
    UID={LoginName}
    PWD={LoginPassword}
    DATABASE={Default Database}

    To use the file in Silk you do the following:
    hdbc = DB_Connect("FILEDSN=c:\Automation\DSN\File.dsn")


    You can create the DSN files on the fly, or put them on a central server and reference them from there.

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

  4. #4
    Member
    Join Date
    Dec 2002
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating creation of DSN

    Thanks Joe. I thought of automating through Silk, but Silk (I am using 6.1.0) doesn't see all the controls.

    CreateDSN is a good option. I am looking in MSDN for the information and couldn't find that call. Do you have your code handy?

    Another thought is I can automate it by creating the necessary registry keys. Has anybody pursued this approach?

    Thanks,

    ------------------
    DJ

    [This message has been edited by djava (edited 04-08-2003).]
    DJ

  5. #5
    Member
    Join Date
    Dec 2002
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating creation of DSN

    Hi tlcranas,

    Thanks for your reply. I am trying to understand it.

    So how do you get the address and stuff? Do you store this file on any server? What is the type of the file, is it an .ini file?



    ------------------
    DJ
    DJ

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

    Re: Automating creation of DSN

    We created an initial file with the ODBC Admin in control panel. There is an option that allows you to make a File DSN. (We used that as out template.) The server address (in our case) is the server name and the IP Port number SQL is using. If you use named pipes, or other protocol the information will be different. Once you have your template, making the changes is the easy part. The file created has DSN extension by default.

    Our DSN's are stored in source safe and are delivered to the test systems each time a test is run. When they are read by Silk, the will reside on the test system.

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

  7. #7
    Member
    Join Date
    Dec 2002
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating creation of DSN

    Thanks all for your replies.

    James, I have a question for you. Pardon me for the basic quesion. Just wanted to confirm that 'Call Registry' functions mean SilkTest's functions e.g. Reg_CreateKey, right?

    And I need to check myself to see if the registry keys exist, right?

    Thanks.

    ------------------
    DJ

    [This message has been edited by djava (edited 04-08-2003).]
    DJ

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

    Re: Automating creation of DSN

    That's right...use SYS_GetRegistryValue to check if the ODBC entry is already there and if it isn't, then call functions to create one. Functions to create a registry key and others that aren't in the base product can be downloaded from AmeliorTech

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

  9. #9
    Member
    Join Date
    Dec 2002
    Posts
    98
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating creation of DSN

    Thanks James.

    Now I have one more question. I created a System DSN with the help of following registry keys.

    Is there any other registry key that I need to set?

    The reason I am asking this question is after creating these reg keys, I can see an entry in the 'System DSN' for 'DSNName'. But I can't use 'ODBC Data Source Administrator' to 'Configure' and/or Remove' this entry, the only once I can 'Configure' and/or Remove' are the once I created using 'ODBC Data Source Administrator'. Is it expected behaviour or am I missing something?

    Thanks again for your help. I really appreciate it.



    ------------------
    DJ
    DJ

  10. #10
    Senior Member
    Join Date
    Jun 1999
    Location
    Fremont, CA, USA
    Posts
    355
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Automating creation of DSN

    Might also want to check out Posts:
    http://www.qaforums.com/Forum1/HTML/002923.html



    ------------------
    David Genrich
    david.genrich@e2open.com
    david@linuxpuppy.net

 

 
Page 1 of 2 12 LastLast

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 07:32 AM.

Copyright BetaSoft Inc.