Results 1 to 2 of 2

Thread: Setting DSN at runtime for Data Environment Designer

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Posts
    1
    How do you set the Data Environment's DSN at runtime?
    The reason I wish to do this is because the DSN will change depending on a condition.

    We set the ConnectionString property at runtime but when a command was executed, a dialog box pops-up prompting for the selection of a DSN.


  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124
    Do you have some sample code. I do not use a dsn. Is this an option for you? I build the connection string and store the test servername nad the production server name in a variable. Depending which server was selected move the appropriate server.
    Code:
        m_strConnectString = "Provider=MSDASQL.1;" _
                           & "Persist Security Info=False;" _
                           & "Driver={SQL Server};" _
                           & "Server=" & iif(bTestserver,strTestServerAddress,strProdServerAddress) & ";" _
                           & "database=AG1DB01;" _
                           & "User ID=" & m_strUserID & ";" _
                           & "Password=" & m_strPassword & ";"

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