SQL in Wonderware

Serafin

Member
Join Date
Mar 2012
Location
Monterrey
Posts
12
Hello,

I am trying to retrieve MySQL (remote server) data from a 7.1 Intouch Wonderware application running on Windows NT.

I have intalled the ODBC driver version 2.50.19 for MySQL from TCX DataKonsult AB and am able to connect to the remote server (couldn't install newer drivers).

However, whenever I try to execute an SQLSelect function I keep getting an "Invalid Pointer" error. My guess is that I haven´t configured properly the bind list, since I haven't found a tutorial on how to do it.

I just simply matched a tagname with a column name, but I get the feeling that is not correct.

Here's the code that I'm using:

Code:
ResultCode = SQLConnect(ConnectionID, "MyDSN");

IF ResultCode == -1 THEN
     texto = SQLErrorMsg(ResultCode);
ENDIF;

ResultCode = SQLExecute(ConnectionID, "", 0);

ResultCode = SQLSelect(ConnectionID, "MyTable", "MyBindList", "id = 1", "");

IF ResultCode == -1 THEN
     texto = SQLErrorMsg(ResultCode);
ENDIF;

ResultCode = SQLEnd(ConnectionID);
ResultCode = SQLDisconnect(ConnectionID);

Does anyone have an idea of what I'm doing wrong?

Thanks in advance.
 
Yes, I was able to perform a SELECT statement in the database (actually the same SELECT that I am trying to perform from Wonderware).

I haven´t take a look to the manual and could not be downloaded from your link, apparently there is something wrong with it.
 
Thanks for the information.

What I've found is that the error is apparently generated by MySQL rather than Wonderware. However I haven't still found what I am doing wrong.
 
The issue is now solved. It had to do with my MDAC version. I wasn't using the proper version, which is 2.5 SP2.

Thanks for your help.
 

Similar Topics

1. Why Wonderware crash after SQL crashes. Can I get something official of AVEVA?
Replies
1
Views
1,048
I’m trying to get data from a column in sql server to post in wonderware. My select script is as follows...
Replies
8
Views
4,524
I have a wonderware standalone HMI collecting process data from our production line. I am writing those values to a database in MySQL, though I...
Replies
0
Views
2,734
I am new to Wonderware and am trying to display a few columns of information from an SQL database onto one of my HMI screens. The SQL database...
Replies
1
Views
3,357
This is a pretty general question since I'm just beginning on these fronts, but does anyone know of a good "Where to Start" type of tutorial? I...
Replies
1
Views
1,919
Back
Top Bottom