> I am currently working on an application that uses a license key (made up
> by
[quoted text clipped - 11 lines]
> change their logon to exclusive. In my mind that would keep other FE from
> connecting. Is there a way to do that programatically? Any other ideas?
Maybe you could check to see if other are logged into the BE when a
workstations tries to connect.
If others are using the BE you can deny access.
There are ways to get a list of the users that are using a the BE.
Maybe that's a way to go.
Jesper Fjølner
Russ Scribner - 07 Mar 2006 22:53 GMT
Thanks Jesper,
I'm looking into using the WhosOn() function that I found on several
websites to look at how many are logged into the ldb on the BE. Is that what
you were referring to?

Signature
Russ Scribner
> > I am currently working on an application that uses a license key (made up
> > by
[quoted text clipped - 19 lines]
>
> Jesper Fjølner
Russ,
I haven't tested this against a multiuser database, but you could try
setting the following property:
CurrentProject.Connection.Properties("Jet OLEDB:Connection Control")
Setting it to 1 prevents more than 1 user from connecting to the database.
Setting it to 2, alows multiple users to connect.
Use something like the following, called from the AutoExec macro:
Public Function VerifyLicense()
If IsMultiUser Then
CurrentProject.Connection.Properties("Jet OLEDB:Connection Control")
= 2
Else
CurrentProject.Connection.Properties("Jet OLEDB:Connection Control")
= 1
End If
End Sub
Like I said, I've never tried this on a multiuser database. If it works,
great, if not, no harm done (provided you set the property back to 2).
Failing that, you can use the following (which is adapted from code written
(I think) by Dev Ashish).
Private Const JET_SCHEMA_USERROSTER =
"{947bb102-5d43-11d1-bdbf-00c04fb92675}"
Public Function LimitUsers(iNumber As Integer) As Boolean
'Compare the number of database users to a provided number,
'and if greater, shutdown the current database instance.
Dim rs As ADODB.Recordset
Dim iCtr As Integer
'Make sure the programmer allows at least one user.
If iNumber = 1 Then iNumber = 2
'Open the roster.
Set rs = CurrentProject.Connection.OpenSchema( _
adSchemaProviderSpecific, , JET_SCHEMA_USERROSTER)
'rs.RecordCount doesn't work reliably here, so we need to cycle
'through the recordset to count the number of users.
Do While Not rs.EOF
iCtr = iCtr + 1
'If the number of users exceeds iNumber, then shutdown the
'current database instance.
If iCtr > iNumber Then GoTo Proc_Shutdown
rs.MoveNext
Loop
'Clean up
rs.Close
Set rs = Nothing
Exit Function
Proc_Shutdown:
'Clean up before shutting down the current database instance.
rs.Close
Set rs = Nothing
Application.Quit
End Function
Regards,
Graham R Seach
Microsoft Access MVP
Canberra, Australia
---------------------------
> Hello,
>
[quoted text clipped - 15 lines]
>
> Thanks...
Russ Scribner - 09 Mar 2006 19:45 GMT
Thanks for the good ideas Graham. I think I've got it solved with the
WhosOn() function - but your ideas would probably have been simpler...
Thanks again...

Signature
Russ Scribner
> Russ,
>
[quoted text clipped - 87 lines]
> >
> > Thanks...