WonderWare SQLErrorMsg function question

jkennlaw

Member
Join Date
Apr 2011
Location
lawrence, ks
Posts
2
Need help trying to resolve a problem with using the SQLErrorMsg function. I use SQLSelect to query a MSAccess list to search for a product code and the data associated with it. I want to generate an alarm if no code is found. When trying to use Error message function I only get a 0 (no errors occurred) result code. I would think that I should be getting a -5 (no more rows to fetch) result code. All data comes thru correctly when a product code is found and nothing comes thru when a product code is not found. This should generate an error, but does not. Have to tried to rewrite script in several different ways without success.
 
Please post your script. It may be something as simple as adding the following statement after your select:

ResultCode = SQLFirst(ConnectionID);

Can't tell for sure until I see your script.
 
Thanks for the tip.
It was as simple as that.
Why does WW not show that in any of their help files on the subject? Been driving me crazy. Thanks again!🍻
 
I know it's not very intuitive. The result code for the SQLSelect has nothing to do with how many rows were returned, only if the select was successful, i.e. if it was able to query based on the bind list, criteria, etc.. Results are returned to a "pivot table" in memory, and you have to use the SQLFirst statement to move the pointer to the top of the list. If there is nothing in the list, you will get your desired return value.

Glad it was a simple fix. I like those.(y)
 

Similar Topics

Hi guys, I have experience with PLC to Excel etc...just starting on using intouch scada screens. I have an Excel sheet that uses mainly...
Replies
1
Views
152
Hello everyone, Recently, my Archestra IDE shut down while I was editing. After restarting the IDE, I noticed warning symbols under my opened...
Replies
1
Views
102
Good morning all. I'm working on a rehab where they had a standalone InTouch 2014 HMI that they called a SCADA, but it's really basic stuff. The...
Replies
4
Views
183
Hi, We are setting up an Aveva Plant SCADA node with the intention to connect it to a Wonderware Historian node. Everywhere I look online I see...
Replies
1
Views
180
Hola chicos. Tengo un problema con el driver de comucicacion dasabcip 5, y un plc controllogix v34, ya realice la comunicacion pero en ciertos...
Replies
2
Views
165
Back
Top Bottom