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
Solved

How to check if a table is exclusively locked in VB6

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 73
Copy a row 12 64
Powerpoint 2013: Change cell reference in excel link 3 77
adding "ungroup sheets" to existing vbs code 5 28
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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

809 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