MS Access 2003: Output Records to Something Other Than Debug.Print

Joined
Mar 27, 2010
Messages
1
Reaction score
0
I'm trying prevent new connections and to see all of the users who have my db open. The code below works but it just dumps the fields into the immediate window. I'd like it to output to a text box or something on a form. Any suggestions? I know just enough VBA to be dangerous so take it easy on me.

Thanks

Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset

cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=\\hbfrna01\public\production\amplifiers\dszewczak\db1.mdb"
cn.Properties("Jet OLEDB:Connection Control") = 1

Set rs = cn.OpenSchema(adSchemaProviderSpecific, , _
"{947bb102-5d43-11d1-bdbf-00c04fb92675}")

Do While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1), _
rs.Fields(2), rs.Fields(3)
rs.MoveNext
Loop
 
Back
Top