473,372 Members | 936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

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 7684

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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.