Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

No VB runtime error when SQL statement fails

 
   Database Help (Home) -> Visual Basic -> DAO RSS
Next:  Need to open Visual Fox Pro 8 tables in VB6  
Author Message
Jarek

External


Since: Feb 06, 2004
Posts: 4



(Msg. 1) Posted: Sat Feb 07, 2004 12:40 am
Post subject: No VB runtime error when SQL statement fails
Archived from groups: microsoft>public>access>queries, others (more info?)

I am currently developing a VB6 program which uses MS Access over DAO.

When I issue an SQL statement which contains a syntax error, my VB error
handler jumps in and I can rollback the transaction. So far, so good.

But, when there is a constraint violation, the SQL statement still fails,
but no VB error is being generated. I cannot trap this situation, I cannot
rollback the transaction. I commit, and then the database is corrupted.

What can I do?

 >> Stay informed about: No VB runtime error when SQL statement fails 
Back to top
Login to vote
Phil Hunt

External


Since: Feb 05, 2004
Posts: 15



(Msg. 2) Posted: Sat Feb 07, 2004 12:40 am
Post subject: Re: No VB runtime error when SQL statement fails [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

try Call db.Execute(SQL, dbFailOnError)


"Jarek" <I.hate.spammers.jarekbed.DeleteThis@poczta.onet.pl> wrote in message
news:c00u82$3t0$1@atlantis.news.tpi.pl...
 > I am currently developing a VB6 program which uses MS Access over DAO.
 >
 > When I issue an SQL statement which contains a syntax error, my VB error
 > handler jumps in and I can rollback the transaction. So far, so good.
 >
 > But, when there is a constraint violation, the SQL statement still fails,
 > but no VB error is being generated. I cannot trap this situation, I cannot
 > rollback the transaction. I commit, and then the database is corrupted.
 >
 > What can I do?
 >
 >
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: No VB runtime error when SQL statement fails 
Back to top
Login to vote
Jarek

External


Since: Feb 06, 2004
Posts: 4



(Msg. 3) Posted: Sat Feb 07, 2004 6:13 pm
Post subject: Re: No VB runtime error when SQL statement fails [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks a lot. Exactly what I needed.


Użytkownik "Phil Hunt" <phung DeleteThis @ktintl.com> napisał w wiadomości
news:%23C2PWdP7DHA.2676@TK2MSFTNGP10.phx.gbl...
 > try Call db.Execute(SQL, dbFailOnError)
 >
 >
 > "Jarek" <I.hate.spammers.jarekbed DeleteThis @poczta.onet.pl> wrote in message
 > news:c00u82$3t0$1@atlantis.news.tpi.pl...
  > > I am currently developing a VB6 program which uses MS Access over DAO.
  > >
  > > When I issue an SQL statement which contains a syntax error, my VB error
  > > handler jumps in and I can rollback the transaction. So far, so good.
  > >
  > > But, when there is a constraint violation, the SQL statement still
fails,
  > > but no VB error is being generated. I cannot trap this situation, I
cannot
  > > rollback the transaction. I commit, and then the database is corrupted.
  > >
  > > What can I do?
  > >
  > >
  > >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: No VB runtime error when SQL statement fails 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
is there any sql statement for ... - hi, i want to select between 100th and 200th records on a table. is there any sql statement for that like TOP statement. I know TOP statement returns absultely (or percently when use TOP PERCENT) top records. But i need between 100th and 200th records...

Jet error - I've just started getting this error message on a seemingly random basis. 'The Microsoft Jet database engine does not recognize 'CID' as a valid field name or expression.' CID is a text field, and it is a valid column name. The line of code that..

Error 3043 - We are supporting an older app written in VB 6.0 (sp5), with Jet 3.51 connected to Access 97 databases. For most users, the system works great, but at a few sites we hit error 3043 which then causes the dreaded 3343 error. At one site, this seems to..

Error Trapping - I am trying to trap the error that raises when you attempt to query a database that does not exist. noted that DAO.DBEngine.Error.Count does contain the value of how many errors have happened. Just cant seem to catch the error so that It can be handled..

error 3265 - can anyone pls tell me what to do? i have done all the connections that need to be done, but this error keep comming-up (error 3265) please help -- http://www.dbForumz.com/ This article was posted by author's request Articles individually checked for....
   Database Help (Home) -> Visual Basic -> DAO All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]