473,414 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

who is using ms access database

Hello,
i have developed a small program in VB 6.0 and the backend is MS ACCESS.
i want to know who is currently logged ms access database. Some body accessing this database by using my program which is located in a local server. some times i need to modify the database. Hence i need to open ms access exclusively for me. But i am unable to open it. it was locked by some other user. if i know that user name, i can ask him to exit the program.
Can anyone give some ideas how to know the current user of this database.

Thanks
Raj
Jan 4 '07 #1
7 2206
hariharanmca
1,977 1GB
Hello,
i have developed a small program in VB 6.0 and the backend is MS ACCESS.
i want to know who is currently logged ms access database. Some body accessing this database by using my program which is located in a local server. some times i need to modify the database. Hence i need to open ms access exclusively for me. But i am unable to open it. it was locked by some other user. if i know that user name, i can ask him to exit the program.
Can anyone give some ideas how to know the current user of this database.

Thanks
Raj

You want Modify tables or Database Name
Jan 4 '07 #2
You want Modify tables or Database Name
I want to modify table only.

thanks
Raj
Jan 6 '07 #3
Hi Raj,

I use this code (modify name of database and path (in 2 places) to suit your environment):
Expand|Select|Wrap|Line Numbers
  1. Sub ShowUserRoster()
  2.     Dim cn As New ADODB.Connection
  3.     Dim cn2 As New ADODB.Connection
  4.     Dim rs As New ADODB.Recordset
  5.     Dim i, j As Long
  6.  
  7.     cn.Provider = "Microsoft.Jet.OLEDB.4.0"
  8.     cn.Open "Data Source=c:\yourdatabase_with_path.mdb"
  9.  
  10.     cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
  11.     & "Data Source=c:\yourdatabase_with_path.mdb"
  12.  
  13.     ' The user roster is exposed as a provider-specific schema rowset
  14.     ' in the Jet 4 OLE DB provider.  You have to use a GUID to
  15.     ' reference the schema, as provider-specific schemas are not
  16.     ' listed in ADO's type library for schema rowsets
  17.  
  18.     Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
  19.     , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
  20.  
  21.     'Output the list of all users in the current database.
  22.  
  23.     Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
  24.     "", rs.Fields(2).Name, rs.Fields(3).Name
  25.  
  26.     While Not rs.EOF
  27.         Debug.Print rs.Fields(0), rs.Fields(1), _
  28.         rs.Fields(2), rs.Fields(3)
  29.         rs.MoveNext
  30.     Wend
  31.  
  32. End Sub
  33.  
Jan 6 '07 #4
hariharanmca
1,977 1GB
I want to modify table only.

thanks
Raj

See, when the table in the database is used by other user or sometimes your application may use that table in that time you can’t change the design structure of that table, check that your application Run Mode was stop properly and then try to change the table design.
Jan 6 '07 #5
hariharanmca
1,977 1GB
Hi Raj,

I use this code (modify name of database and path (in 2 places) to suit your environment):
Expand|Select|Wrap|Line Numbers
  1. Sub ShowUserRoster()
  2.     Dim cn As New ADODB.Connection
  3.     Dim cn2 As New ADODB.Connection
  4.     Dim rs As New ADODB.Recordset
  5.     Dim i, j As Long
  6.  
  7.     cn.Provider = "Microsoft.Jet.OLEDB.4.0"
  8.     cn.Open "Data Source=c:\yourdatabase_with_path.mdb"
  9.  
  10.     cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
  11.     & "Data Source=c:\yourdatabase_with_path.mdb"
  12.  
  13.     ' The user roster is exposed as a provider-specific schema rowset
  14.     ' in the Jet 4 OLE DB provider.  You have to use a GUID to
  15.     ' reference the schema, as provider-specific schemas are not
  16.     ' listed in ADO's type library for schema rowsets
  17.  
  18.     Set rs = cn.OpenSchema(adSchemaProviderSpecific, _
  19.     , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
  20.  
  21.     'Output the list of all users in the current database.
  22.  
  23.     Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
  24.     "", rs.Fields(2).Name, rs.Fields(3).Name
  25.  
  26.     While Not rs.EOF
  27.         Debug.Print rs.Fields(0), rs.Fields(1), _
  28.         rs.Fields(2), rs.Fields(3)
  29.         rs.MoveNext
  30.     Wend
  31.  
  32. End Sub
  33.  
yes, i work on that its fine
Jan 6 '07 #6
yes, i work on that its fine
it is working fine.
thank you all.
Raj
Jan 8 '07 #7
Hello,
i have developed a small program in VB 6.0 and the backend is MS ACCESS.
i want to know who is currently logged ms access database. Some body accessing this database by using my program which is located in a local server. some times i need to modify the database. Hence i need to open ms access exclusively for me. But i am unable to open it. it was locked by some other user. if i know that user name, i can ask him to exit the program.
Can anyone give some ideas how to know the current user of this database.

Thanks
Raj
ya im using MS access with VB6.0
if need any kind of help ask me..okkkkkkkkkkkk
Jan 8 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

38
by: Remco Groot Beumer | last post by:
Hello, I'm trying to decide if the following situation would be workable: Generate an MS Access Front End (which will run localy on client computers), which will link to a DBMS (SQL server or...
5
by: dananrg | last post by:
I've created a small company database where the tables reside in a SQL Server database. I'm using Access 2000 forms for a front end. I've got a System DSN set-up to SQL Server and am using links...
1
by: Matt Alanzo | last post by:
On another newsgroup an Access knowledgable party posted: >You should be able to connect an Access ADP to an existing SQLExpress >database running in SQLS 2000 compatibility mode. The only thing...
10
by: B Moor | last post by:
Host PC: Win SBS 2003 with 2.6 GHz processor and 1GB RAM SQL Server 2000 sp3 (or latest).MS Office 2k3 I have the access 2k3 front end running on server (this may get changed) and all was well...
8
by: Carl | last post by:
Hi, Using MS Access 2000, is it possible to run a UPDATE or INSERT SQL query using some form of conditional IF THEN ?? for example: SELECT * FROM Books IF EXISTS(Select Books.ID = 1)
6
by: Serious_Practitioner | last post by:
Good day all, and thank you in advance for your help. No - MANY thanks in advance for your help - I know nothing about using databases on Web servers. I am about to discuss a project with a...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
4
by: Bugs | last post by:
Hi everyone. I am trying to open a database which works fine using Access 2003, but when trying to open it on another PC that has Access 2002 I get the following error "This database is...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.