473,396 Members | 2,098 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,396 software developers and data experts.

vb access run time error 3705

I'm creating a VB6 application to import data from a temp Access
database to a production Access database. I have set up a Data
Enviorment to communicate with my production database since I the
application centers around it. During the import I create a temporary
connection to connect to the temp
database.

The application is cycle through the records in the temp database and
then import the records that do not exist into the production database.
When I run the application to test it I get a run time error #3705,
Operation is not allowed when the object is open.

I get that error when this part of the code executes, DE.FindOrderByRef
rsNew("orderID"). That is executing a command I have set up in my Data
Enviornment to simply find out if that order is in our production
database.

I have searched various website and news groups but couldn't find
anything that would help. Unfortunately this simple action is key to
the larger application. Any help would be apprceciated.

------------------------- CODE -----------------------------
Dim tempConn As New ADODB.Connection
Dim rsNew As New ADODB.Recordset

tempConn.Open "ImportOfflineOrders"

rsNew.ActiveConnection = tempConn
rsNew.Open "NewOrders"

Do Until rsNew.EOF

DE.FindOrderByRef rsNew("orderID")

Debug.Print DE.rsFindOrderByRef.RecordCount

rsNew.MoveNext

Loop

Nov 13 '05 #1
2 12142
browndude wrote:
I'm creating a VB6 application to import data from a temp Access
database to a production Access database. I have set up a Data
Enviorment to communicate with my production database since I the
application centers around it. During the import I create a temporary
connection to connect to the temp
database.

The application is cycle through the records in the temp database and
then import the records that do not exist into the production database.
When I run the application to test it I get a run time error #3705,
Operation is not allowed when the object is open.

I get that error when this part of the code executes, DE.FindOrderByRef
rsNew("orderID"). That is executing a command I have set up in my Data
Enviornment to simply find out if that order is in our production
database.

I have searched various website and news groups but couldn't find
anything that would help. Unfortunately this simple action is key to
the larger application. Any help would be apprceciated.

------------------------- CODE -----------------------------
Dim tempConn As New ADODB.Connection
Dim rsNew As New ADODB.Recordset

tempConn.Open "ImportOfflineOrders"

rsNew.ActiveConnection = tempConn
rsNew.Open "NewOrders"

Do Until rsNew.EOF

DE.FindOrderByRef rsNew("orderID")

Debug.Print DE.rsFindOrderByRef.RecordCount

rsNew.MoveNext

Loop


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Huh? What's a Data Environment? This is an Access news group not a VB
news group.

Well, we still use VBA & I can see that you have 2 references to
DE.FindOrderByRef that are different:

1 DE.FindOrderByRef rsNew("orderID")

2 Debug.Print DE.rsFindOrderByRef.RecordCount

Line 2 should, probably, be:

Debug.Print rsFindOrderByRef.RecordCount

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQpd+a4echKqOuFEgEQIxQACfQm9fjYdcHZZ1RnfGXeeRsK 6Pk4oAoPxl
4ll2fkQEw56VmVnG3oYU7kF2
=o9CF
-----END PGP SIGNATURE-----
Nov 13 '05 #2
Figured it out after sometime.
DE.FindOrderByRef rsNew("orderID")

Debug.Print DE.rsFindOrderByRef.RecordCount

rsNew.MoveNext


Must close the recordset before opening it again. Thought I was
happening automatically.

Nov 13 '05 #3

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

Similar topics

5
by: NB | last post by:
Hi In my 2 years with Access I have never seen this, now it makes me mad In an unbound form frmTH I have a frmList which is a continous form In its on current event, I synch 4 of its fields...
0
by: crypto_solid via AccessMonster.com | last post by:
I have been using a SQL database with a VB5 frontend for about 5 years. Works well. Unfortunately I don't have access to the source code. I was tasked with implementing a "job entry" application...
6
by: geronimo_me | last post by:
Hi, I am trying to run an Excel macro from an Access module, however when I run the code the macro runs but then I get an error in Access. The error is: Run-time error "440", Automation error. ...
1
by: thetuckers_jersey | last post by:
I have inherited an Access database with a SQL backend and need to run a daily report. When I try to run this report which calls stored procedures, I get the following VB error message : Run-time...
4
by: Christaaay | last post by:
I have been using the code below successfully for almost a year. yesterday, I began getting a run time error 6 (overflow). I am using the code in an Access 2000 database. Can anyone help me...
0
by: rc | last post by:
Moved a working MS Access application from Win2000 (version 5.0 SP 3) OS with MS Access 2000 and DB2 Run-time client v7.1 FP 4 to XP (version 5.1, SP 2) OS with MS Access 2003 and DB2 Run-time...
2
by: jr | last post by:
Hello everyone! I am new to this sort of postings so I'm not even sure if this is the correct place to start. Anyway, I would realy appreciate any help. I have a some VBA code that works quite...
0
by: 362315 | last post by:
I am receiving the following error: Microsoft Visual Basic Run-Time error '2147467259 (80004005)': The microsoft jet database engine cannot open the file. It is already opened exclusively by...
7
vikas1111
by: vikas1111 | last post by:
Hi All.... I have created a form in which i call other forms from the main form .. When i click a perticular botton twice there is an error .. Can anyone help me to solve my problem.. The error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
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...
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,...

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.