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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROBLEM WITH TRANSACTIONS!!!

Status
Not open for further replies.

moroeh

Programmer
Oct 22, 2001
25
0
0
ES
Hello:

I have a problem (polite way of saying 'I have no idea') when using transactions. I have read in some other threads, and in Microsoft's knowledge database, that it is not possible to use transactions with the docmd.runSQL object. So I am trying to figure out how to work with QueryDefs.

I actually need to make some changes accepted or not in case all the records are within the especifications I set up for them.

The database is working this way. For example, I have 'n' invoices with products. The program then should take all the products in the invoice I choose and substract them from the table warehouse (if there is enough cuantity of them, in the first place). So I use a recordset to get the products in the given invoice. With this recordset I upgrade the information in the warehouse and at the same time I must insert the information of those products in another table for further use.

I am trying to use transactions with QueryDef but I don't know how to do it right (The only way I have founded is with CreateQueryDef, but I don't want to create the queries as I have to use this function more than once on each session).

Thanks in advance!

Igor M.

imorillo@zuhar.com
 
Not sure if I understand correctly, but you can look at the Execute method in help.
CurrentDb.Execute "SELECT ..."
querydef.Execute
Maybe Set rst = CurrentDb.OpenRecordset("SELECT ...", dbOpenDynaset).
 
Hi again:

Thanks, but what I really need is some help (maybe a link or a howto... I don't know for sure) about how to use transactions and querydefs (I believe this is the only way for using transactions).

I'm been reading my post again and I realize there is almost no way to understand what I was talking about. Sorry about that!

Igor M.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top