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
7 2206
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
You want Modify tables or Database Name
I want to modify table only.
thanks
Raj
Hi Raj,
I use this code (modify name of database and path (in 2 places) to suit your environment): -
Sub ShowUserRoster()
-
Dim cn As New ADODB.Connection
-
Dim cn2 As New ADODB.Connection
-
Dim rs As New ADODB.Recordset
-
Dim i, j As Long
-
-
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
-
cn.Open "Data Source=c:\yourdatabase_with_path.mdb"
-
-
cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
-
& "Data Source=c:\yourdatabase_with_path.mdb"
-
-
' The user roster is exposed as a provider-specific schema rowset
-
' in the Jet 4 OLE DB provider. 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}")
-
-
'Output the list of all users in the current database.
-
-
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
-
"", rs.Fields(2).Name, rs.Fields(3).Name
-
-
While Not rs.EOF
-
Debug.Print rs.Fields(0), rs.Fields(1), _
-
rs.Fields(2), rs.Fields(3)
-
rs.MoveNext
-
Wend
-
-
End Sub
-
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.
Hi Raj,
I use this code (modify name of database and path (in 2 places) to suit your environment): -
Sub ShowUserRoster()
-
Dim cn As New ADODB.Connection
-
Dim cn2 As New ADODB.Connection
-
Dim rs As New ADODB.Recordset
-
Dim i, j As Long
-
-
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
-
cn.Open "Data Source=c:\yourdatabase_with_path.mdb"
-
-
cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" _
-
& "Data Source=c:\yourdatabase_with_path.mdb"
-
-
' The user roster is exposed as a provider-specific schema rowset
-
' in the Jet 4 OLE DB provider. 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}")
-
-
'Output the list of all users in the current database.
-
-
Debug.Print rs.Fields(0).Name, "", rs.Fields(1).Name, _
-
"", rs.Fields(2).Name, rs.Fields(3).Name
-
-
While Not rs.EOF
-
Debug.Print rs.Fields(0), rs.Fields(1), _
-
rs.Fields(2), rs.Fields(3)
-
rs.MoveNext
-
Wend
-
-
End Sub
-
yes, i work on that its fine
yes, i work on that its fine
it is working fine.
thank you all.
Raj
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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)
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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,...
|
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...
|
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...
|
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...
|
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...
|
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...
| |