Link to home
Start Free TrialLog in
Avatar of Bob Schneider
Bob SchneiderFlag for United States of America

asked on

Trouble Opening SQL Server DB

I have a vb6 app that uses a sql server express database.  Suddenly I am having difficulty opening it.  Here is what I use to open the db:

    sWhichSrvr = lstWhichComp.Text
    
    Call Hourglass
    
    Set conn = New ADODB.Connection
    
    If sWhichSrvr = "Remote" Then
        conn.Open "Provider=SQLNCLI10;Server=216.185.199.1,1433\SQLExpress;Database=VIRA;Uid=xxx;Pwd=xxx;"
    Else
        conn.Open "Provider=SQLNCLI10;Server=" & sWhichSrvr & "\SQLExpress;Database=VIRA;Trusted_Connection=yes;"
    End If

Open in new window


Now I get an error when I try to access the db.  What might cause that to change?  Antivirus?  Malware?  I don't think I have added any of that since last use.

Thanks so much!!
SOLUTION
Avatar of David Todd
David Todd
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bob Schneider

ASKER

I will post the error code and look at the remote cinnection but it is the lcal connection i am hing trouble with...and it worked until just recently
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am not near my desk and I will post it when I get home but the gist of it is that it can't find the database.  Lets not forget that IT HAS WORKED WELL UNTIL RECENTLY (all caps for emphasis, not for anger :) ).  The db is in the same place.  My concern is what would cause it to suddenly stop working.  Hmmmm.....
Now it is working, and my machine just underwent an upgrade...wierd.  Thank you.
If it happens again, please send the error. There should be something in the error message that can lead us to the problem.

Cheers