Results 1 to 3 of 3

Thread: Database Connection

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Posts
    688

    Database Connection

    Hi

    I have written the below Sql connection for SQL

    cnn1.Open "Driver=SQL Server;Server=" & ServerName & ";Database=" & "TEMP" & ";uid=" & uid & ";pwd=" & pwd & ";"

    I want to check if connection is successful if should give message
    "Successful"
    else
    "Error Connection"


    Thanks

  2. #2

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Database Connection

    Does that connection string actually work? I don't think I've ever used ODBC but I've always seen the driver name wrapped in braces any time I've seen an ODBC connection string.

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