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

Error Trapping

 
   Database Forums (Home) -> Visual Basic -> DAO RSS
Next:  What's the part number for the installation CD-RO..  
Author Message
Khal




Joined: Nov 22, 2004
Posts: 2



(Msg. 1) Posted: Mon Nov 22, 2004 4:52 pm
Post subject: 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 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.

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




Joined: Nov 22, 2004
Posts: 2



(Msg. 2) Posted: Mon Nov 22, 2004 5:06 pm
Post subject: Re: Error Trapping [Login to view extended thread 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: 99



(Msg. 3) Posted: Thu Nov 25, 2004 1:40 am
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.DeleteThis@dbForumz.com> wrote in message
news:41a27d61$1_4@alt.athenanews.com...
 > eh thats query a database table.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Error Trapping 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
dao recordset error trapping - I have a dao recordset which I update with the following code: With rsOrderShip .Edit !CustCode = frmOrders.txtSTCustCode.Text !stcustname = frmOrders.txtSTCustName.Text !staddress1 = frmOrders.txtSTAddress1.Text ....

Can someone please help me to fix an error ? - I am using VB.NET. I just created a form where user enters information. Once information is entered, user clicks ok button. While updating the table, I am getting an error and it does not update. I am using 2 tables, INVSHIP and PARTSQTY. Both hav...

Authentication Error??? - Ok so heres the code.. for some reason I kept getting the no permissions message, so I attempted to add the access workgroup file. Now I get the "Authentication Failed" message. This is a secure database. HELP.. I know I'm writing (adding) som...

Runtime Error 91 - Hi I have a VB6 Application wich connect to an Access 97 database. We have a function to connect to the database like this Dim wrkDefault As Workspace Set wrkDefault = DBEngine.Workspaces(0) Set objDatabase =..

Error 3167 recordset is delete - Hello, ich habe in verschiedenen Newsgroups gesucht aber keine Lösung zu dem folgenden Problem gefunden. Zwei Personen arbeiten gemeinsam mit einem VB6-Programm an einer ACCESS 2000 Datenbank Der Zugriff von VB auf ACCESS erfolgt mit DAO 3.60. Eine de...
   Database Forums (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 ]