CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2001
    Posts
    6

    Creating a DSN file at run-time.

    I had to create a DSN to create a linked table in Access from SQLServer...AT RUN-TIME.

    I found out from MSDN articles that it can be done by API calls..but guess what I did ?

    I did it like this..

    Open App.Path & "\thedsn.dsn" For Output As #13
    Print #13, "[ODBC]"
    Print #13, "DRIVER=SQL Server"
    Print #13, "UID = sa;"
    Print #13, "Database = Goldmine"
    Print #13, "SERVER=(local)"
    Print #13, "Description=Connection to Goldmine database"
    Close #13

    ..and this works.

    I want to know

    "is this acceptable ?"
    "is this the best method to create a DSN at run-time ?"
    "are there any implications invilved in this ?"

    Please comment..

    Thanks in advance
    Anand Sagar
    [email protected]



  2. #2
    Join Date
    Aug 2001
    Location
    London, England
    Posts
    3

    Reg

    I had to do this but i made a DSN in the registry. Look in HKEY_LOCAL_MACHINE\Software\ODBC for guidence, you should be albe to pick up whats needed then create a folder and the keys to make your DSN. I have some code if you want it. [email protected]


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured