ShowUsers Dilemma

  • Thread starter Thread starter Bonnie
  • Start date Start date
B

Bonnie

Using AXP. Working with "Determine Who Is Logged onto a
Database by Using Microsoft Jet UserRoster in Access 2002"
at http://support.microsoft.com/default.aspx?scid=kb;en-
us;285822&Product=acc2002. Put it on one DB, works great.
Try it on others, no go. ??? I get a "Compile error: User-
defined type not defined" on the first line under Sub. The
beginning reads:

Sub ShowUserRosterMultipleUsers()
Dim cn As New ADODB.Connection 'errors here'
Dim rs As New ADODB.Recordset
Dim i, j As Long

Set cn = CurrentProject.Connection

Weird that it works on one file but not others. DB's are
all A02. Any ideas? Thanks in advance for any help!

Also, if I change the sub to a function, can I call it
from a button on a form? But how would I have it print on
the form/report rather than the Immediate Window the way
it's now set?
 
Hi,
It sounds like not all your DBs have a reference to ADO.
Check your references. With any code module open, go to
Tools->References and make sure you have a reference to the latest version
of Microsoft ActiveX Data Objects.

HTH
Dan Artuso, MVP
 
Thank you, thank you, thank you! Simple things to gurus
but manna from heaven to novices such as I.

I truly appreciate your guidance. Why all the DBs I
checked did not have a reference to 2.7 Library, I don't
know, but now they do. You are brilliant!
 
Back
Top