Solved

How to check if a table is exclusively locked in VB6

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now