Re: dbFailOnError causing varible error.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I really know to little about transactions, but until someone
with experience shows up, or you find some infor yourself,
I think the following hopefully gives a starting point.

Initialize/assign cn as your connection variable

cn.begintrans
cn.execute <some sql>
' more stuff?

if <some condition> then
   cn.committrans
else
   cn.rollbacktrans
end if

There's a more comprehensive sample in the help files, and I guess
a search through the newsgroup would also give some information.

But do also take Graham Mandeno's advice into consideration
(using DAO in stead of ADO), if you're only working with Jet.

Fred Wilson wrote in message <4a6dnRbIOZc9gkLfRVn-rg@xxxxxxxxxxx> :
Roy,

Thanks for your input. I will look into the transaction thing. I've never heard of it so if you can give me a head start on where to look, it would be much appreciated.

Fred


RoyVidar wrote:
I think that might depend on what you rely on dbFailOnError for. If it's
rolling back in case of error,  perhaps look into transactions, if it is
getting the error message(s), check into looping the errors collection
(retrieve it through the connection) - but I'm not using DAO much, so...

Fred Wilson wrote in message <42DE2BB4.6090906@xxxxxxxxxxx> :

So if I am reading all of this correctly, there is NOT a dbFailOnError for ADO?


RoyVidar wrote:

Try the execute method of the connection object, for instance

currentproject.connection.execute strSQl

or

dim cn as adodb.connection
set cn=currentproject.connection
' or open a connection to the database where you wish to insert this
' see
'http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForMicrosoftJet

' watch linebreaks in the link
cn.execute strsql

CurrentDB is, as I've understood it, a reference to the current DAO database
object


Frederick Wilson wrote in message <f5udnYIk2_-SMEDfRVn-2Q@xxxxxxxxxxx> :

OH BOY, the whole ADO DAO thing. I can not keep one from another. How do I know whether or not I have any code that is DAO. I guess if this failure is any indication I have not DAO code anywhere.

What would I use to make CurrentDB.Execute an ADO statement?

Thanks,
Fred





-- Roy-Vidar

.



Relevant Pages

  • Re: Container-managed Transactions scope
    ... Updates and Deletes are inside an EJB method. ... Now i am starting to use DAO pattern. ... safe because of Container-managed Transactions. ...
    (comp.lang.java.programmer)
  • Re: Transactions in Access 2000
    ... DAO ones do. ... I need to use transactions to make sure data is consistent. ... like ADO as to make the db as portable between Access versions ... ADO you shouldn't have a portability problem. ...
    (comp.databases.ms-access)
  • Re: Which Object to use for Tansaction process
    ... The only way to use a single object to wrap the transactions is if you use ... DAO or ADO exclusively. ...
    (microsoft.public.access.forms)
  • Application crashes while performing operations on the MS Access D
    ... DLL uses DAO to connect to a DB, which is an MS Access 97 DB. ... times (usually when the size of the Access DB crosses 70MB), ... maintain atmocity of transactions (the Execute call is between these two ...
    (microsoft.public.access.queries)
  • Re: dbFailOnError causing varible error.
    ... dim cn as adodb.connection ... CurrentDB is, as I've understood it, a reference to the current DAO database ... I guess if this failure is any indication I have not DAO code anywhere. ...
    (microsoft.public.access.formscoding)