Gammachaser
Programmer
I have a Function that I have been using to determine what other workstations are logged into a database using the CurrentProject.Connection. It worked well until Access 2010 got pushed to my pc and now I get the subject line error message. I also had Access97 and Access2003 on my pc so the IT folks here told me to get rid of the other versions because they were causing conflicts. I can understand that and since I had other problems that looked like corruption, I got rid of both older versions and some of the problems persisted. So, I had Access2010 reinstalled and all of the other problems went away, but I still get this message. The real kicker is it still works on two other machines I have tested it on that also got upgraded.
Here is the code (much of which I got somewhere on this site.)
The databse is split, copies run independenly on each machine. Indications are that something is wrong on my pc, but since I had Access2010 reloaded and all other problems went away, I am stumped. The failure is on the line 'Set cn = CurrentProject.Connection' Any ideas? I am not very strong on ADO...
Here is the code (much of which I got somewhere on this site.)
Code:
Function LoggedInPCs() As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set cn = CurrentProject.Connection
Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
While Not rs.EOF
Select Case rs!Connected
Case True
LoggedInPCs = LoggedInPCs & Trim(rs!Computer_Name)
While Right(LoggedInPCs, 1) = Chr(0)
LoggedInPCs = Left(LoggedInPCs, Len(LoggedInPCs) - 1)
Wend
Select Case Left(rs!Computer_Name, Len(fOSMachineName)) = fOSMachineName
Case True
LoggedInPCs = LoggedInPCs & " (This Computer)"
End Select
LoggedInPCs = LoggedInPCs & vbCrLf
End Select
rs.MoveNext
Wend
rs.Close
Set rs = Nothing
Set cn = Nothing
End Function
The databse is split, copies run independenly on each machine. Indications are that something is wrong on my pc, but since I had Access2010 reloaded and all other problems went away, I am stumped. The failure is on the line 'Set cn = CurrentProject.Connection' Any ideas? I am not very strong on ADO...