Recently a bit of code which has worked solidly for a few months now has stopped working. There have been no upgrades (Windows or otherwise) done to any product that we have pushed out.
The code below pushes data into a SQL Server 2008 database:
Dim db As New ADODB.Connection
''#Other data manipulation not shown
With db
''#On Error Resume Next ''# With or without this line I still get no indication of the error
.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Data Source=myDB;" & _
"Use Procedure for Prepare=1;Auto Translate=True; Packet Size=4096; Use Encryption for Data=True;" & _
"Tag with column collation when possible=false;Initial Catalog=SFM_market"
.Open
.Execute query
.Close
End With
The db State field reads 0. It is my understanding that it should read 1 when it has connected successfully.
I have also recently re factored to use ADODB.Command along with an ADODB.Connection, but the end result is the same. The state field remains at 0. I get no errors, the data simply does not go into the database since the connection is not made.
Any ideas on why this may be?
Just for completeness, the answer to this was a simple restart. There was nothing wrong with the way I connected.