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