473,473 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ADO Connection Open fails with error -2147467259 when MS Access database under Source Safe

gm
Immediately after generating the Access application from the Source
Safe project I get:

"-2147467259 Could not use ''; file already in use."

If Access database closed and then reopened I get:

"-2147467259 The database has been place in a state by user
'Admin' on machine ..... that prevents it from being opened or
locked."

This error will then persist - even past a machine reboot and compact
and repair of both application db (without source safe removal) and
'server' db. If I remove the Access application from Source Safe
the ADO connection opens fine. (Might have to close database and
reopen it to get it working the first time after eliminating source
safe.)

I do not appear to be short on memory. Am using:

Access 2003 with sp1
Source Safe 6.0d
Windows XP Professional with sp2
Database in Access 2002-2003 format
Microsoft ActiveX Data Objects 2.7 Library

I have isolated error in test database with just one table and one
form. Test1 fails under source safe while Test2 - which avoids use
of the offending open command -works regardless of use of source safe.

Any illumination on this would be appreciated. I have found the Source
Safe & Access combination hard going but I do not want to loose source
code control. This issue has undermined my confidence in these tools
yet again. Many thanks.
GM

Option Compare Database
Option Explicit

Private Sub cmdTest1_Click()
On Error GoTo Error_Handler

Dim cnn As ADODB.Connection
Dim rtbl As ADODB.Recordset
Dim lngTest As Long

Set cnn = New ADODB.Connection
Set rtbl = New ADODB.Recordset

lngTest = 1

' Have tried eliminating the with block - no difference. GM
With cnn
.ConnectionString = CurrentProject.Connection
.Open ' This Open command fails with -2147467259 error if
application under source safe. GM
End With

'Open 'insert cursor' on test table
rtbl.Open "Table1", cnn, adOpenStatic, adLockOptimistic, adCmdTable
With rtbl
.AddNew
!col1 = lngTest
.Update
End With

MsgBox "Test1 Inserted OK"

Exit_Sub:
On Error Resume Next
rtbl.Close
cnn.Close
Set cnn = Nothing
Set rtbl = Nothing
Exit Sub

Error_Handler:
MsgBox "An error has occured in this application. " _
& " Please contact your techincal support person and " _
& " tell them this information: " _
& vbCrLf & vbCrLf & "Error Number " & Err.Number & ", " _
& Err.Description, _
Buttons:=vbCritical
Resume Exit_Sub
Resume
End Sub
Private Sub cmdTest2_Click()
On Error GoTo Error_Handler

Dim rtbl As ADODB.Recordset
Dim lngTest As Long

Set rtbl = New ADODB.Recordset
lngTest = 2

'Open 'insert cursor' on test table
rtbl.Open "Table1", CurrentProject.Connection, adOpenStatic,
adLockOptimistic, adCmdTable
With rtbl
.AddNew
!col1 = lngTest
.Update
End With

MsgBox "Test2 Inserted OK"

Exit_Sub:
On Error Resume Next
rtbl.Close
Set rtbl = Nothing
Exit Sub

Error_Handler:
MsgBox "An error has occured in this application. " _
& " Please contact your techincal support person and " _
& " tell them this information: " _
& vbCrLf & vbCrLf & "Error Number " & Err.Number & ", " _
& Err.Description, _
Buttons:=vbCritical
Resume Exit_Sub
Resume

End Sub

Jan 25 '06 #1
0 7692

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cp | last post by:
I have a business object (c#) running on an app server that talks to my sql server 2000 (2 separate physical machines). If sql server gets restarted (i.e. someone kicks the cord out of the wall on...
4
by: Scott B | last post by:
Can someone perhaps give me some insight as to why I am getting an OleDbexception when I try to run the following code. What I am looking to do is test if the connection could be opened and if...
6
by: karim | last post by:
I have an asp.net page that stopped running properly giving the error below. The app uses a SQL Server 2000 on another server. Enterprise Manager and Query analyzer on the web server can connect to...
6
by: M | last post by:
Hi, Does SqlDataAdapter always close the connection (assuming connection was closed before calling Fill()), even if an exception occurs while calling Fill()? Example: try {...
0
by: Sergey Poberezovskiy | last post by:
Hi, My VB.Net (1.1) application connects to ASP.Net (1.1) WebService that resides on ISP Server. My client successfully runs this application from 4 out of 5 PCs. On that one PC I receive the...
0
by: Christopher H. Laco | last post by:
I'm in a strange situation. I have a dataset that uses it own connection string from MySettings. All is well. This thing works in .NET just dandy. If I reference this dataset from another...
1
by: Yofnik | last post by:
I am writing an application that simulates a TCP device that only accepts one connection at a time. For my application, I would like connection requests to fail if one already exists. So far I have...
29
by: Bryce K. Nielsen | last post by:
Suddenly this week, I've started getting this error message: System.Data.SqlClient.SqlConnection(GetOpenConnection)ExecuteNonQuery requires an open and available Connection. The connection's...
6
by: Bjoern Schliessmann | last post by:
Hello, I'm currently trying to implement a simulation program with Kamaelia and need a reliable TCP connection to a data server. From Twisted, I know that a method is called if the connection...
5
by: chrispoliquin | last post by:
Hi, I have a small Python script to fetch some pages from the internet. There are a lot of pages and I am looping through them and then downloading the page using urlretrieve() in the urllib...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.