Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO and grid control

Status
Not open for further replies.

splaisance

Programmer
Jul 2, 2001
67
US
I have a program that opens a db/2 database via ado connection and binds it to a grid control. I am search for a way to allow the user to make changes to records in the grid but if they hit a command button these changes will not be saved in the database. Does ado have a similar function to RDO's ROLLBACK and COMMIT??

Does anyone have any suggestions on how to do this?

Thanks for your help!!!

splaisance
 
ADO Connection Object has a .BeginTrans, .commitTrans, and . rollbacktrans
 
Hmmmm

I must be doing something wrong then - perhaps you can spot it in this code:

Set Cmd = New adodb.Command
Set Cmd.ActiveConnection = SWBC_Conn

SWBC_Conn.BeginTrans

SQLcode = "select * from Libl.Tabl where rptname = " & ReportString & " AND rptlcode = " & LeadCodeNum & " ORDER BY rptlcode"

Cmd.CommandText = SQLcode
Cmd.Prepared = True

' Create a recordset by executing the command.
Set rsLeadLines = Cmd.Execute()



**********

without the line 'SWBC_Conn.BeginTrans' the code works fine.
with it i get errors stating that the as/400 server application (DDM) is not started. Yet without this line i have been able to fully maintenance the data from this program. Any ideas?

Basically I just need to know how to undo changes the user might make in the grid.....


UGH! I think i'm gonna go nuts!

Thanks!

splaisance
 
Im sorry, I did not read your problem fully. The commit, and rollback will work on the connection object(cnConnection.commitTrans). I am not sure how you would do it with bound controls. I will try a couple of things..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top