?
Solved

Stop Recordset to update (Urgent)

Posted on 2005-03-10
10
Medium Priority
?
146 Views
Last Modified: 2013-11-26
hi i have got a record set formed by a join query and everytime i add a new row in it and run resync command it updates the values in the table but i dont want it to update the values in the table unless i actually perform an (Save Record method or update batch method)on it. Is there any possibility to do this because i have got a scenario where the user enter the values but then press the 'cancel' button or exit the application so it shouldn't save the values in the table.

if i set the .activeconnection property to nothing (rs.activeconnection=nothing) then it doesn't let me use the resync property so please tell mehow can i make this possible .....

please help!!!!!!!!!!!
0
Comment
Question by:parmoon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 19

Accepted Solution

by:
Shauli earned 375 total points
ID: 13505277
One way to do it is to work with unbound control, where you load the data from your table(s) to the control, but the control is not connected after you finished loading it.
Then is you need to add a new record, you can use INSERT INTO as in:

YourConnection.Execute "INSERT INTO tablename (fieldname1, fieldname2, fieldname3.... ) VALUES (value1, value2, value3....)"

For updateing an existing record you can use "UPDATE' as in:

YourConnection. Execute "UPDATE table name SET fieldname1 = vlaue1, fieldname2 = value2.... WHERE filednameID = valueID"

S
0
 

Author Comment

by:parmoon
ID: 13506474
is there any other solution ???????
0
 
LVL 6

Assisted Solution

by:PePi
PePi earned 375 total points
ID: 13508317
try using BeginTrans and CommitTrans. you use this by setting it in your ADO Connection object

adoConn.BeginTrans
...
     add the new row
     do the resync


when you do your save record method go:

adoConn.CommitTrans


if the users hit Cancel then:

adoConn.RollbackTrans


Hope this is what you are looking for.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:parmoon
ID: 13509157
Error: No transaction is active.....
0
 
LVL 6

Expert Comment

by:PePi
ID: 13511207
try stepping through your code. mark those that have BeginTrans, CommitTrans & RollbakTrans and see where this error is being thrown
0
 

Author Comment

by:parmoon
ID: 13517382
when i try to committrans then it throws this error

"No transaction is active"
0
 
LVL 6

Expert Comment

by:PePi
ID: 13519310
did you issue the BeginTrans method prior to your adding of a new row & resynch? did you close the connection somewhere in between?
0
 
LVL 8

Expert Comment

by:wraith821
ID: 13649105
what are you using to gather the data for the new row. is it another form or in a datagrid with the current query. i would suggest using a different form to gather the data then when the user clicks ok save and do the resync, else just exit the form.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question