Solved

How to check if a table is exclusively locked in VB6

Posted on 2001-07-21
3
258 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

776 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