Solved

How to check if a table is exclusively locked in VB6

Posted on 2001-07-21
3
262 Views
Last Modified: 2011-09-20
I want to test whether a Table in Access 2000 is exclusively locked using VB6

Thanks!
0
Comment
Question by:rcbarot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Expert Comment

by:hongjun
ID: 6304883
Try this

Private Sub Form_Load()
On Error GoTo Err_Handle
    Dim objConn As ADODB.Connection
   
    Set objConn = New ADODB.Connection
   
    objConn.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=c:\windows\profiles\hongjun\desktop\db1.mdb;uid=sa;pwd=;"
   
    objConn.Close
    Set objConn = Nothing
    Exit Sub
   
Err_Handle:
    If Err.Number = -2147467259 Then
        MsgBox "File is exclusively locked"
    End If
End Sub

hongjun
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7135225
A request has been made (http://www.experts-exchange.com/cleanup/Q_20320181.html) that this question be closed with the following resolution: points to hongjun

EXPERTS: Please leave any comment regarding this request here; I will return in seven (7) days to close the question.

Netminder
CS Moderator
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7141372
Wrong comment selected as Answer.

hongjun: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20321325

Netminder
CS Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question