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

how to error code from DB2 communication area!

 
   Database Help (Home) -> Visual Basic -> ODBC RSS
Next:  How to connect  
Author Message
markus.boese

External


Since: Aug 10, 2005
Posts: 1



(Msg. 1) Posted: Wed Aug 10, 2005 7:37 am
Post subject: how to error code from DB2 communication area!
Archived from groups: microsoft>public>vb>database>odbc (more info?)

Hello,
we are working with excel vba and we are quering data from DB2 using
odbc driver from IBM.
This works without a problem as long as I do no mistake (syntax for
example). But if my sql-syntax is not correct, the makro crashes. I
don't know how to catch the error code from DB2. I even don't know if
there is an error code sent through odbc back to excel. And if so how
to query this error code.

If anyone has suggestions, I'd be very thrilled.
Thanks
Markus

P.S.:
The vba code I use looks like this:

With ActiveSheet.QueryTables.Add(Connection:= _
connect_string, Destination:=Range("A5"))
.CommandText = Array(sql_string)
.AdjustColumnWidth = False
.Refresh BackgroundQuery:=False
End With

where sql_string and connect_string are variables which of course were
filled before.

 >> Stay informed about: how to error code from DB2 communication area! 
Back to top
Login to vote
Ralph

External


Since: Jan 28, 2008
Posts: 34



(Msg. 2) Posted: Wed Aug 10, 2005 11:52 am
Post subject: Re: how to error code from DB2 communication area! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote in message

> Hello,
> we are working with excel vba and we are quering data from DB2 using
> odbc driver from IBM.
> This works without a problem as long as I do no mistake (syntax for
> example). But if my sql-syntax is not correct, the makro crashes. I
> don't know how to catch the error code from DB2. I even don't know if
> there is an error code sent through odbc back to excel. And if so how
> to query this error code.
>
> If anyone has suggestions, I'd be very thrilled.
> Thanks
> Markus
>
> P.S.:
> The vba code I use looks like this:
>
> With ActiveSheet.QueryTables.Add(Connection:= _
> connect_string, Destination:=Range("A5"))
> .CommandText = Array(sql_string)
> .AdjustColumnWidth = False
> .Refresh BackgroundQuery:=False
> End With
>
> where sql_string and connect_string are variables which of course were
> filled before.
>

Lookup "On Error" in the online Excel VBA Editor.
Lookup DAO "Error" and "Errors" on the MSDN CD or Website
(Exact navigation depending on Office and DAO Versions)

hth
-ralph

 >> Stay informed about: how to error code from DB2 communication area! 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Compile Error - Can anyone please help me to solve this problem I have when I tried to compile and run my program written in VB 6.0? Problem: I used variable declaration such as db as Database and ws as Workspace. I use ODBC way to connect my VB form interface with....

What is the solution for this application error - HI While Multiple users executing exe of VB with MySQL as database, following error occurs during middle of processing. The exe is closed during this error.If we open exe again it works successfully. This error occurs more than once during execution...

Cursor Error w/ ODBC SQL2000 - My office inherited a legacy VB6 program that connects via a MSRDC to a SQL2000 server. The original ODBC connection pointed to a legacy Win2000 Adv Server w/ SQL2k, we have upgraded a test server Win2k3 w/ the same SQL2k. The previous server didn't..

The OdbcCommand is currently busy Fetching. error message - I have reimplemented Application block to read to a postgresql Database, but I have a problem in the following code : Protected Overloads Overrides Function ExecuteReader(ByVal connection As IDbConnection, _ ByVal transaction As IDbTransaction, _ ByVal...

.MDB table linked to Oracle backend - #S_C_H# error - This has cropped up a few times, but I have yet to find a satisfactory answer. My company uses an .mdb with tables linked to an Oracle backend through ODBC (MS Oracle driver). Until recently this was working fine, however something changed (no one ca...
   Database Help (Home) -> Visual Basic -> ODBC All times are: Pacific Time (US & Canada)
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 ]