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

Error Trapping

 
   Database Help (Home) -> Visual Basic -> DAO RSS
Next:  Password problem  
Author Message
Khal

External


Since: Nov 22, 2004
Posts: 2



(Msg. 1) Posted: Mon Nov 22, 2004 6:58 pm
Post subject: Error Trapping
Archived from groups: microsoft>public>vb>database>dao (more info?)

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 correctly, heres what I am
trying to do so far

code:
Private Sub CheckReferenceTable()
on DBEngine.Errors.Count < 1 goto referencehandler

sqlCommand = "Select * FROM [REFERENCE]"
DB.OpenRecordset sqlCommand

Exit Sub
ReferenceHandler:
sqlCommand = "CREATE TABLE [REFERENCE] ([TABLE NAME])": Set RS =
DB.OpenRecordset(sqlCommand)
CheckReferenceTable
End Sub

NOte the on statement is theoretical to get the idea across
On Error Resume Next will not work in this instance.

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/DAO-Error-Trapping-ftopict172906.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=580080

 >> Stay informed about: Error Trapping 
Back to top
Login to vote
Khal

External


Since: Nov 22, 2004
Posts: 2



(Msg. 2) Posted: Mon Nov 22, 2004 6:59 pm
Post subject: Re: Error Trapping [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

eh thats query a database table.

 >> Stay informed about: Error Trapping 
Back to top
Login to vote
Unicorn

External


Since: Nov 14, 2003
Posts: 98



(Msg. 3) Posted: Thu Nov 25, 2004 4:10 pm
Post subject: Re: Error Trapping [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Loop through the dbengine errors collection.

Matt

"Khal" <UseLinkToEmail RemoveThis @dbForumz.com> wrote in message
news:41a27d61$1_4@alt.athenanews.com...
> eh thats query a database table.
 >> Stay informed about: Error Trapping 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
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 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....

DAO360 Error - My application access an mdb database using dao360 and works fine in the VB6 SP6 IDE. When I create a deployment package and try to run it it fails at the first attempt to access a field value. The recordcount is correct and ..movefirst works, but..

Error 3146 (VB6) - I am opening two databases, iterating through a table in one of them and making "INSERT INTO" queries to copy the data to a table in the second (using the execute method). The machines are both physically on the same network segment. I am get...
   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 ]