473,672 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Occasionally Locked Out of Access Database

Running VB coded from Excel to update information from an Access
database.
When the code is run from Excel it works most times. But occasionally
I get error 4866 saying the Access database is opened exclusively by
admin.

Here is the VB code (it locks up on the line with asterisks
*************** *************:

Private Sub CommandButton1_ Click()
ActiveWorkbook. RefreshAll
Worksheets("FLO OR").Range("A1: HH50000").Clear
Dim cnt As New ADODB.Connectio n
Dim rst As New ADODB.Recordset
Dim xlApp As Object
Dim xlWb As Object
Dim xlWs As Object
Dim recArray As Variant
Dim strDB As String
Dim fldCount As Integer
Dim recCount As Long
Dim iCol As Integer
Dim iRow As Integer
strDB = Worksheets("inp ut").Range("C4" )
Set xlApp = Application
Set ap = CreateObject("A ccess.Applicati on")
ap.OpenCurrentD atabase (strDB)
cnt.Open "Provider=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=" & strDB & ";"
xlApp.Sheets("F LOOR").Select
rst.Open "Select * From [LOTS]", cnt *************** *************
Set xlWb = ActiveWorkbook
Set xlWs = xlWb.Worksheets ("FLOOR")
fldCount = rst.Fields.Coun t
For iCol = 1 To fldCount
xlWs.Cells(1, iCol).Value = rst.Fields(iCol - 1).Name
Next
xlWs.Cells(2, 1).CopyFromReco rdset rst
rst.Close
cnt.Close
xlApp.Sheets("M IN BID BUYERS").Select
Set ap = Nothing
Set rst = Nothing
Set cnt = Nothing
Set xlWs = Nothing
Set xlWb = Nothing
Set xlApp = Nothing
End Sub

Thanks in advance for your suggestions. Could there be something that
is left open in the closing statements of the subroutine above? Maybe
it works a few times and then is opened too many times - is there some
limit that is being exceeded possibly? Grasping for an explanation
here...
Nov 12 '05 #1
0 3164

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

Similar topics

6
5662
by: DebbieG | last post by:
I have created a database for a client and was told that it was to be a one-user database. Well, you know the next statement ... now they want 3 people to be able to use the database. (FYI, I have never created a database for multiusers. I've done some searching but not finding what I want.) I have split the database. In Tools, Options, I have set the following: Default open mode = Shared Default record locking = Edited Record
1
1430
by: Carlos Sol | last post by:
Good day I am having a problem developing a web application for an on line catalog. I am using ms access XP on an XP professional platfrom. I have been able to succesfully develop a web page to query the database to produce a list of items in groups of 10, but when I request the next 10 items the server returns the following error: "Error Type: Provider (0x80004005)
2
12852
by: Captain Nemo | last post by:
Hi I seem to remember that in Access 2000 you can sometimes get a bogus error message telling you that a certain table is 'locked by another user', when there is no way that could be true. Unfortunately, I can't remember what the workaround (if any) might be. Can anyone help?
4
2762
by: hkappleorange | last post by:
I ued this code to connect to a mdb file A = New OleDbConnection( "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=C:\Inetpub\wwwroot\ASPX\Authors.mdb" )
1
7914
by: amindi | last post by:
Hi, I wrote a VB6 program to read some data records from a Ms Access database and to write them into a SQL server database.(I use Ms Access 2000 and SQL server 2000).After reading each record in Access database, I update a text type datafield of that record in Access database to 'Y' (to mark the perticular record as a copied record)(The program does the updation). I tested the program several times by using a seperate copy of the same database...
5
14426
by: Glen Buell | last post by:
Hi all, I have a major problem with my ASP.NET website and it's SQL Server 2005 Express database, and I'm wondering if anyone could help me out with it. This site is on a webhost (WebHost4Life) and was running fine and dandy, until I decided I needed to add some additional stored procedures to the database.
15
4104
by: chaseexchange | last post by:
First, a brief explanation of why this has happened. I purchased, what I thought, was a fully functional program written in Access last year from a local programmer. This program was to be used as my POS for an online DVD store. It turns out that what the programmer actually gave me was a "license" to use his software. This was not the agreement we made, and he knows this. He took advantage of the fact that I knew very little about...
3
2085
by: ksarkies | last post by:
Hi This is a "problem" I've been battling for many days and haven't been able to understand; various postings I've come across on the Internet seem to not quite provide the answer. We have a commercial (membership database) application written around Access 2002 and we are using Access 2003 to run it on Server 2003 (64 bit), and 32 bit XP Pro. The database file is locked in some way so that it can't be opened within Access, even when using...
11
5012
by: fniles | last post by:
One of our application uses VB6 and Access97 database. Another application uses VB.NET 2005. This morning for about 15 seconds when the application tries to read either a query or a table from the database, in in both VB6 and VB.NET applications, I got the error "The Microsoft Jet database engine cannot find the input table or query 'myTable'. Make sure it exists and that its name is spelled correctly." Also, I got the error "The...
0
8488
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8408
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8932
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8832
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8685
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6240
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2067
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1819
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.