Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-22-2019, 11:35 AM   #1
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 999
Thanks: 72
Thanked 49 Times in 42 Posts
MickJav will become famous soon enough
CheckCurrentUsers_v?

This relates to isladogs CheckCurrentUsers_v?


I have found using the below code with the connection sting below it works just fine
C:\Database Dreams\Project Manager\Project Manager Data.accdb

But with this one it fails
C:\Database Dreams\Project Manager\Clients A-Z Folders\D\Database Dreams\Project - Works Manager - P-41-52\Design Version\Works Data.accdb



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

Private Sub Form_Load()
On Error GoTo Err_Handler
Dim C As Long

     cn.Provider = CurrentProject.Connection.Provider
    
    'Get data source
     cn.Open "Data Source=" & Replace(CurrentDb.TableDefs("TableName").Connect, ";DATABASE=", "")
     
    'The user roster is exposed as a provider-specific schema rowset
    'You have to use a GUID to reference the schema, as provider-specific schemas
    'are not listed in ADO's type library for schema rowsets
    Set rs = cn.OpenSchema(adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
        While Not rs.EOF
           C = C + 1
        rs.MoveNext
        Wend
    Me![txtNo] = C
Exit_Handler:
    Exit Sub

Err_Handler:
    
    'errors with network files to be ignored
    If Err = 3705 Or Err = 3704 Or Err = -2147467259 Or Err = 94 Then Resume Next
    
    'If Err <> 3265 Then
        MsgBox "Error " & Err.Number & " in " & " procedure : " & vbNewLine & _
            Err.Description, vbExclamation, "Program error"
    'End If
 Resume Exit_Handler

End Sub
my test form I had my developer verson as user version connected to that data file

Attached Images
File Type: png 2019-09-22 (2).png (9.8 KB, 104 views)
File Type: png 2019-09-22 (3).png (3.8 KB, 97 views)

__________________
All open code examples and free projects are only available from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Creating a new project then add styles to it download open code example from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by MickJav; 09-23-2019 at 09:08 AM.
MickJav is offline   Reply With Quote
Old 09-22-2019, 11:46 AM   #2
June7
AWF VIP
 
June7's Avatar
 
Join Date: Mar 2014
Location: The Great Land
Posts: 2,422
Thanks: 0
Thanked 567 Times in 563 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: CheckCurrentUsers_v?

You have subfolders D and Database Dreams?

Really looks like two path strings smushed together.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Old 09-22-2019, 12:03 PM   #3
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 999
Thanks: 72
Thanked 49 Times in 42 Posts
MickJav will become famous soon enough
Re: CheckCurrentUsers_v?

Quote:
Originally Posted by June7 View Post
You have subfolders D and Database Dreams?

Really looks like two path strings smushed together.

No It's for inhouse programs while other folders are client realated It make it easy to backup keeping all together.


thanks mick

__________________
All open code examples and free projects are only available from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Creating a new project then add styles to it download open code example from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
MickJav is offline   Reply With Quote
Old 09-22-2019, 01:08 PM   #4
June7
AWF VIP
 
June7's Avatar
 
Join Date: Mar 2014
Location: The Great Land
Posts: 2,422
Thanks: 0
Thanked 567 Times in 563 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: CheckCurrentUsers_v?

Sorry, I don't understand how that can be a valid path reference.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Old 09-22-2019, 01:18 PM   #5
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,375
Thanks: 434
Thanked 804 Times in 779 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: CheckCurrentUsers_v?

I don't see anything wrong with the path, other than that it has a huge heirarchy?
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 09-22-2019, 01:20 PM   #6
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 999
Thanks: 72
Thanked 49 Times in 42 Posts
MickJav will become famous soon enough
Re: CheckCurrentUsers_v?

Quote:
Originally Posted by June7 View Post
Sorry, I don't understand how that can be a valid path reference.
No problem my system work by adding a folder when a new client is added then creates a folder when a project is created for that client all files are kept in the main clients folder

I'm going to try reducing the connection string to see where if fails but would not expect a connection string that long for a standard system or network
__________________
All open code examples and free projects are only available from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Creating a new project then add styles to it download open code example from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
MickJav is offline   Reply With Quote
Old 09-22-2019, 01:22 PM   #7
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,006
Thanks: 114
Thanked 3,014 Times in 2,741 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: CheckCurrentUsers_v?

Agree with June - its a very peculiar path which appears to be a mixture of drive letter and UNC
The generic description for error 3251 is Operation is not supported for this type of object
You haven't said which line triggers the error but it may be that a path of that length /complexity is too long for the old LDB roster cde to handle

Try copying the files to a shorter path and see if it now works
Also have a look at the other David Crake utility I updated which is in my opinion a more useful application anyway: Password login with session login recording

__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


"As we know, there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns the ones we don't know we don't know. It is the latter category that tend to be the difficult ones" Donald Rumsfeld
isladogs is offline   Reply With Quote
Old 09-22-2019, 01:23 PM   #8
June7
AWF VIP
 
June7's Avatar
 
Join Date: Mar 2014
Location: The Great Land
Posts: 2,422
Thanks: 0
Thanked 567 Times in 563 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: CheckCurrentUsers_v?

Sure, it's a valid path if there really are subfolders named "D" and "Database Dreams".

But "D" looks like a mapped drive letter.
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Old 09-22-2019, 01:31 PM   #9
Gasman
Enthusiastic Amateur
 
Gasman's Avatar
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 4,375
Thanks: 434
Thanked 804 Times in 779 Posts
Gasman is a jewel in the rough Gasman is a jewel in the rough Gasman is a jewel in the rough
Re: CheckCurrentUsers_v?

Quote:
Originally Posted by June7 View Post
Sure, it's a valid path if there really are subfolders named "D" and "Database Dreams".

But "D" looks like a mapped drive letter.
I took the D to be a sub folder in the A-Z parent?
I agree it is very complicated, overly complicated perhaps, but if that is what the use?

Anythng that long I might even use the Subst command

https://helpdeskgeek.com/how-to/assi...rs-in-windows/
__________________
Access novice. Sometimes trying to give something back.
Access 2007

Please, please use code tag # when posting code snippets

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Gasman is offline   Reply With Quote
Old 09-22-2019, 09:15 PM   #10
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 999
Thanks: 72
Thanked 49 Times in 42 Posts
MickJav will become famous soon enough
Re: CheckCurrentUsers_v?

It's only for internal use makes finding things easy been using it for 20 years nearlly or since windows 98 at least.
my system puts a company starting with say J into folder J for jolly crumets ltd.
never had a problem when linking front and backends but was thinking it was to long so will move the current db underdesign


Moved it to:
C:\Database Dreams\Project Manager\Clients A-Z Folders\Underdesign\Works Manager Design Version\Works Data.accdb
And works fine thanks all mick
__________________
All open code examples and free projects are only available from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Creating a new project then add styles to it download open code example from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by MickJav; 09-22-2019 at 09:32 PM.
MickJav is offline   Reply With Quote
Old 09-22-2019, 10:51 PM   #11
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 999
Thanks: 72
Thanked 49 Times in 42 Posts
MickJav will become famous soon enough
Re: CheckCurrentUsers_v?

Just remembered why I designed the folder structure like that it was originally stored on a network but had to move it when server died but will move the A-Z folders to c drive as an looking at getting another server.

On a different note I am getting a count of 2 using the code I posted above I'm new to this sort of thing is that correct.

Many thanks and very nice job isladogs I'll be using it from now on
__________________
All open code examples and free projects are only available from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Creating a new project then add styles to it download open code example from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
MickJav is offline   Reply With Quote
Old 09-22-2019, 11:42 PM   #12
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,006
Thanks: 114
Thanked 3,014 Times in 2,741 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: CheckCurrentUsers_v?

For the benefit of other members this thread refers to the example app available at https://www.access-programmers.co.uk...d.php?t=295174

@Mick
If you are using the utility to check users in an external app, you will always see an extra record for that utility marked CurrentDB=Yes. That was how the original app by David Crake was set up.
If you think that is confusing, you can filter the list to exclude that record or just use the code within the application that you are checking.

Hope that helps
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


"As we know, there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns the ones we don't know we don't know. It is the latter category that tend to be the difficult ones" Donald Rumsfeld
isladogs is offline   Reply With Quote
The Following User Says Thank You to isladogs For This Useful Post:
MickJav (09-22-2019)
Old 09-22-2019, 11:55 PM   #13
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 999
Thanks: 72
Thanked 49 Times in 42 Posts
MickJav will become famous soon enough
Re: CheckCurrentUsers_v?

Thanks I'll just set c=-1 which will give me a correct count of users accessing the data file thanks for your help
Mick

Ps its checking a linked data file from front end
__________________
All open code examples and free projects are only available from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Creating a new project then add styles to it download open code example from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
MickJav is offline   Reply With Quote
Old 09-23-2019, 05:26 AM   #14
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,006
Thanks: 114
Thanked 3,014 Times in 2,741 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: CheckCurrentUsers_v?

Why check a linked datafile from the front end?
The users will just be those using the frontend so you just need to check the current frontend app.
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin (Mendip Data Systems)
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


"As we know, there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns the ones we don't know we don't know. It is the latter category that tend to be the difficult ones" Donald Rumsfeld
isladogs is offline   Reply With Quote
Old 09-23-2019, 05:54 AM   #15
MickJav
Newly Registered User
 
Join Date: Nov 2005
Location: Margate
Posts: 999
Thanks: 72
Thanked 49 Times in 42 Posts
MickJav will become famous soon enough
Re: CheckCurrentUsers_v?

I wanted to check how many were using it I.e. how many front ends were linked to it is there another way of limiting the number of front ends linked to a data file

Thank mick

__________________
All open code examples and free projects are only available from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Creating a new project then add styles to it download open code example from:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
MickJav is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 07:57 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World