Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / February 2006

Tip: Looking for answers? Try searching our database.

VB6 code to Lock access table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
equalive - 03 Feb 2006 07:49 GMT
Hi guys,

I'm having problem locking a table in Ms Access using VB6 code.
Actually I have 3 tables.
Assume table names is A, B, C.

Following is the process.

1. Open table A and update table A. (Must Lock the table A)
2. Open table B and update table B.
3. Open table C and update table C.
4. Open table A and update table A again.(After update...Release the
lock)

Once I open table A for update, I dont want another user to access
table A until i finish step 2, 3, 4. Once step 4 is complete, then I
want to release the lock for table A.

How to do it guys. Hopefully i have given enough and simple explanation
for you to help me.

Thanks Guys.
salad - 03 Feb 2006 15:57 GMT
> Hi guys,
>
[quoted text clipped - 18 lines]
>
> Thanks Guys.

Here's an example of doing it in Access using DAO.
    Dim r As Recordset
    Set r = CurrentDb.OpenRecordset("Table1", dbOpenSnapshot,
dbDenyWrite + dbDenyWrite)
    r.Close
    Set r = Nothing
equalive - 06 Feb 2006 08:40 GMT
Is there a same way I can use using ADO? Because at the moment all my
connection is using ADO.
salad - 06 Feb 2006 19:08 GMT
>> Hi guys,
>>
[quoted text clipped - 25 lines]
>     r.Close
>     Set r = Nothing

I don't have a help file for ADO, tho I do for Access DAO.  Maybe go to
Google Groups, enter "ADO deny read write exclusive" in groups "*ADO*"
or "*ACCESS*" and see what you come up with.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.