Thursday, March 29, 2012

DB2K- VB6 execution halts in between...database error

I am using VB6, on windows XP and using ODBC to connect to DB2 Database on database server internal network. I need to retrieve around 4000 - 5000 records and display information in Rich Text Box (RTB) on VB6 form. When I executes the program, it runs well for sometime and displays around 3000- 3500 records in RTB, then after some time it gives me following error.

Run-time error'-2147467259(80004005)';

[Microsoft][ODBC dBase Driver] Reserved Error (-3034); there is no message for this error.

When I press "DEBUG" button on message error box, it points to 2nd line of following code

strqueryAddrCust = "SELECT CUSTOMER from CUST where CUST_ID = '" + CStr(CustID) + "'"

Set localrecordsetAddrCust = AGFDB.CONAGF.Execute(strqueryAddrCust)
totalRecCountAddrCust = localrecordsetAddrCust.RecordCount

but goes through well while doing single stepping (F8) and executes well . It just stops sometimes.

When I copy the same database on my local host and map network drive to it, code runs perfectly fine without any error.

Please let me know what mght be the possible cause of this error...and any suggestions..

regards,

Anurag GuptaI've replied (http://www.dbforums.com/t991424.html) in the programming language forum. I think that your SQL is just fine, the problem lies elsewhere.

-PatP

No comments:

Post a Comment