|
-
Nov 9th, 2004, 06:48 AM
#1
Thread Starter
Fanatic Member
How would you do this
Hi All,
I open 5 tables like so
VB Code:
CurrentDatabaseName = "Qwest"
rstQwest.Open "Qwest_Details", connQwest, adOpenKeyset
rstQwest2.Open "Qwestname", connQwest, adOpenKeyset
CurrentDatabaseName = "Weldspec"
rstWeldspec.Open "Weldspec_Details1", connWeldspec, adOpenKeyset, adLockOptimistic
rstWeldspec2.Open "Tester_Weldspec", connWeldspec, adOpenKeyset, adLockOptimistic
rstWeldspec3.Open "newtable", connWeldspec, adOpenKeyset, adLockOptimistic
and it fails on this line as I have spelt it wrong.
VB Code:
rstWeldspec.Open "Weldspec_Details1", connWeldspec, adOpenKeyset, adLockOptimistic
What I want to be able to do is to print out the table name that has failed. I could have string and set it to the table name before I open each table. But thought there might be a better way of doing this as it is later on that I want show the result.
Thanks
Loftty
-
Nov 9th, 2004, 07:09 AM
#2
Lively Member
Re: How would you do this
Originally posted by loftty
What I want to be able to do is to print out the table name that has failed. I could have string and set it to the table name before I open each table. But thought there might be a better way of doing this as it is later on that I want show the result.
That would seem like the simplest solution to me. Especially since you want to use the name of the table later on, and not right when the error occurs.
Rate my posts for a chance to win cash and prizes 
-
Nov 9th, 2004, 08:48 AM
#3
KING BODWAD XXI
How would it know what table errored???
In error handing cant you catch the complaint in the err object and print err.description???
-
Nov 9th, 2004, 02:22 PM
#4
You could build the SQL statements out of a series of strings. When the error occurs, you could show the string that coincided with the error that occured. This would take a bit of bookkeeping to do things such as figuring out which line failed, but it would work. However, this is only slightly different from what you are suggesting anyways. The only difference would be that the string holding the tablename would be used in the SQL itself.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|