I cannt access Microsoft SQL server to Intouch

cassidy387

Member
Join Date
Nov 2018
Location
BKK
Posts
14
I've tried following "Wonderware InTouch HMI Supplementary Components Guide" but the value from sql not appear on intouch runtime screen.

I connect MS SQL server in SQL authentication.

action script
resultcode = SQLConnect(ConnectionID1, "Provider=SQLOLEDB;UID=tha;PWD=12;Initial Catalog=WSP;Data Source=WIN-L5BCJAA06OD;");

resultcode = SQLSelect(ConnectionID1, "Table1","Table1","","");

resultcode = SQLFirst(ConnectionID1);


"resultcode" tag name type is Memory integer.
"ConnectionID1" tag name type is Memory integer.

help me please, I dont know what to do.
 
Last edited:
Yes. Look at that while you are trying to get the sql info. It will usually show some info. Also, have you created a bind list?
 
I’m not sure if this is relevant, but maybe try using “user ID” instead of UID and “password” instead of PW in the connection string. That’s how I have mine in a test set-up. I get errors if I try “UID” or “PW”.
 
I’m not sure if this is relevant, but maybe try using “user ID” instead of UID and “password” instead of PW in the connection string. That’s how I have mine in a test set-up. I get errors if I try “UID” or “PW”.

it still not working.actually i also try "database =..." instead "Initial Catalog=..." but it still not working either.
 
Last edited:
That’s odd.
Try adding this to the beginning of the script:

LogMessage(“The Connection Script is Running);

That message should show up in the log viewer when you run the script. If it doesn’t, maybe script isn’t actually running for some reason?
 
That’s odd.
Try adding this to the beginning of the script:

LogMessage(“The Connection Script is Running);

That message should show up in the log viewer when you run the script. If it doesn’t, maybe script isn’t actually running for some reason?

In action script?
Actually same what i mean is same problem but the problems are increased in log viewer.
 
Yes. Try the logMessages in your action script.
Try putting LogMessage(“the sqlConnect is starting”); before your sqlConnect portion.
Try putting LogMessage(“the sqlSelect is starting”); before the sqlSelect portion.
Try putting LogMessage(“the action script is at the end”); at the very end.

Those messages should be showing up in the log viewer.
 
Yes. Try the logMessages in your action script.
Try putting LogMessage(“the sqlConnect is starting”); before your sqlConnect portion.
Try putting LogMessage(“the sqlSelect is starting”); before the sqlSelect portion.
Try putting LogMessage(“the action script is at the end”); at the very end.

Those messages should be showing up in the log viewer.
Ok i will try and tell you later now Its 3:00AM at Thai
Thanks for helping me :)

Is it will help ? Or just showing the message?
 

Similar Topics

Hi I am confused , if i have made some mistake.I am using siemens S7 PLC. I wrote a program in FC and moved some data to a DB memory location...
Replies
2
Views
1,563
I have to provide remote access and control to a touch screen. I was thinking about using Weintek and the Weincloud. Does anyone know if this is...
Replies
1
Views
102
Greetings, I am working on a project and I would like to scale %AI to -10.0 to 10.0 VDC. The module Input data is stored as a 16 bit Integer and...
Replies
4
Views
49
Hi all Trying to remotely connect to a TIA Portal PLC. I can ping it without a problem but can't get my software to connect. I've opened port...
Replies
8
Views
280
Hi All, Can anyone advise me on how to determine the AN of a genie instance I writing to. I have created a genie to display a valve and some text...
Replies
0
Views
81
Back
Top Bottom