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
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.
It would help if you post the error but by the code if have doubts if the line for the remote connection is correct (you shouldn't need the TCP port when you give the instance name).
Try this one:
If sWhichSrvr = "Remote" Then conn.Open "Provider=SQLNCLI10;Server=216.185.199.1\SQLExpress;Database=VIRA;Uid=xxx;Pwd=xxx;" Else conn.Open "Provider=SQLNCLI10;Server=" & sWhichSrvr & "\SQLExpress;Database=VIRA;Trusted_Connection=yes;" End If
Then check the sWhichSrvr value.
Anyway post the error.
0
Bob SchneiderCo-OwnerAuthor Commented:
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.....
0
Bob SchneiderCo-OwnerAuthor Commented:
Now it is working, and my machine just underwent an upgrade...wierd. Thank you.
Is database on autoclose?
What is exact error message?
Regards
David