Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDB Reader. 1

Status
Not open for further replies.

Ed2020

Programmer
Nov 12, 2001
1,899
0
0
GB
Hi,

I want to set up a system to monitor the contents of an LDB file and log the contents into a table in MS Access.

I have the code to read the data out into a variable, however I was expecting to see each connection on a separate line within the file. Does anyone have any code that will enable me to split each connection onto a separate row?

TIA,

Ed Metcalfe.

Please do not feed the trolls.....
 
Function UserRooster(Cnn As ADODB.Connection) As String

Dim rs As ADODB.Recordset
Dim S As String
Set rs = Cnn.OpenSchema(adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
With rs
Do Until .EOF
S = S & "Computer Name: " & Left(Trim(.Fields(0)), Len(Trim(.Fields(0))) - 1) & vbTab
S = S & "User: " & Left(Trim(.Fields(1)), Len(Trim(.Fields(1))) - 1) & vbTab
S = S & "Connected: " & .Fields(2) & vbTab
If (.Fields(3) & "" = "") Then
S = S & "Suspect State: FALSE" & vbCrLf
Else
S = S & "Suspect State: TRUE" & vbCrLf
End If
.MoveNext
Loop
.Close
End With
Set rs = Nothing
UserRooster = S

End Function
 
Perfect! Thank you!

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top