Results 1 to 2 of 2

Thread: Easy Question re: syntax

  1. #1
    Guest
    I had a line of code with conneciton info to a DB hard-coded

    i.e.
    connection.connectstring = "DSN=DSNName;Username=USERNAME;Password=PASSWORD"

    What I am trying to do is have it take the DSNNAME, USERNAME, and PASSWORD from defined variables, but it does not like the syntax. I think it looked like

    blah.connectstring = "DSN=" &DSNName &";Username=" & etc...

    Any idea?

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    88
    This is what you need
    Code:
    objConn.ConnectionString = "DSN=" & DSNName & ";" _
                                          & "UID=" & UserName & ";" _
                                          & "PWD=" & Password
    objConn.Open

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