|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
run time error 3705a 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. I have tried a few different newsgroups but I haven't gotten any replies. ------------------------- 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 Figured it out after sometime.
> DE.FindOrderByRef rsNew("orderID") Must close the recordset before opening it again. Thought I was happening> > Debug.Print DE.rsFindOrderByRef.RecordCount > > rsNew.MoveNext automatically. Show quoteHide quote "cliff" <no@nospamn.com> wrote in message news:uJWJM8sZFHA.796@TK2MSFTNGP09.phx.gbl... > 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. > > I have tried a few different newsgroups but I haven't gotten any replies. > > ------------------------- 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 > > > > Figured it out after sometime.
> DE.FindOrderByRef rsNew("orderID") Must close the recordset before opening it again. Thought I was> > Debug.Print DE.rsFindOrderByRef.RecordCount > > rsNew.MoveNext happening automatically.
Creating a DLL and calling it from an app
How to calculate this? Recent File Parse and preserve an object in a class SP5 to SP6: To update or not? reading a XML file to vb variables Problem with multiple forms How do I deploy a VB6 program to folder whose filename has spaces? Err Object Submitted Text |
|||||||||||||||||||||||