Thanks for the suggestions, I was able to solve the problem. It was so simple and obvious, I should have caught it myself.
I don't think the accidental abnormal IPL was related.
It turns out the file in the SQL request was very large. Over 6 million records, and over 10 years worth of data.
I purged all but the last two years and tried again. Works perfectly now.
Thanks,
Charles
From: Versfelt, Charles
Sent: Friday, January 23, 2026 4:38 PM
To: 'midrange-l@xxxxxxxxxxxxxxxxxx' <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: SQL0666 on VB application doing SQL on AS400 file
We have a number of VB applications accessing the AS/400. At some point yesterday, an accidental IPL of the AS/400 took place.
A coworker was trying to add an external tape drive and suddenly the system went down. I don't know if he pressed a button, or what.
The system just went down. I believe some PTFs were installed when the system came back up.
Anyway, now some of our VB applications are failing when trying to do a SQL on an AS/400 file.
I don't think this happening after a sudden unplanned IPL is a coincidence.
The error my VB applications is getting is SQL0666.
In my research I found this link,
https://www.itjungle.com/2005/07/13/fhg071305-story03/
System value QQRYTIMLMT is *NOMAX. Following the instructions in the itjungle link, I went to ODBC Data Source Configuration.
I checked every Data Source, there were four, only one allowed "Configure," the others it was greyed out.
That one, I saw and unclicked "Enable Query Timeout" and clicked ok.
I'm still getting the error. I'm not sure how to fix this time out issue.
Thanks,
Charles Versfelt
As an Amazon Associate we earn from qualifying purchases.