Re: dbFailOnError causing varible error.
- From: "RoyVidar" <roy_vidarNOSPAM@xxxxxxxx>
- Date: Thu, 21 Jul 2005 07:13:27 GMT
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
.
- References:
- dbFailOnError causing varible error.
- From: Fred Wilson
- Re: dbFailOnError causing varible error.
- From: Graham Mandeno
- Re: dbFailOnError causing varible error.
- From: Frederick Wilson
- Re: dbFailOnError causing varible error.
- From: RoyVidar
- Re: dbFailOnError causing varible error.
- From: Fred Wilson
- Re: dbFailOnError causing varible error.
- From: RoyVidar
- Re: dbFailOnError causing varible error.
- From: Fred Wilson
- dbFailOnError causing varible error.
- Prev by Date: Re: display subform record in main form
- Next by Date: Re: Access 2000 Onnotinlist exact 'add entry to source table' setu
- Previous by thread: Re: dbFailOnError causing varible error.
- Next by thread: Re: dbFailOnError causing varible error.
- Index(es):
Relevant Pages
|