You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old November 7th, 2018, 05:50 AM   #1
cassidy387
Member
Thailand

cassidy387 is offline
 
Join Date: Nov 2018
Location: BKK
Posts: 13
Unhappy I cannt access Microsoft SQL server to Intouch

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 by cassidy387; November 7th, 2018 at 05:52 AM.
  Reply With Quote
Old November 8th, 2018, 11:20 AM   #2
bulletin blues
Lifetime Supporting Member
United States

bulletin blues is offline
 
bulletin blues's Avatar
 
Join Date: Mar 2003
Location: out there
Posts: 177
Are you seeing any errors in the system management console Log viewer?
__________________
_____
  Reply With Quote
Old November 8th, 2018, 11:58 AM   #3
cassidy387
Member
Thailand

cassidy387 is offline
 
Join Date: Nov 2018
Location: BKK
Posts: 13
https://www.img.in.th/images/b916c2d...8d2bd58ea0.png
do you mean this ?

Last edited by cassidy387; November 8th, 2018 at 12:01 PM.
  Reply With Quote
Old November 8th, 2018, 12:08 PM   #4
bulletin blues
Lifetime Supporting Member
United States

bulletin blues is offline
 
bulletin blues's Avatar
 
Join Date: Mar 2003
Location: out there
Posts: 177
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?
__________________
_____
  Reply With Quote
Old November 8th, 2018, 12:12 PM   #5
cassidy387
Member
Thailand

cassidy387 is offline
 
Join Date: Nov 2018
Location: BKK
Posts: 13
Quote:
Originally Posted by bulletin blues View Post
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?
Yes i created it.The column name is same in MS SQL server.

Could you tell me the solution ?

Last edited by cassidy387; November 8th, 2018 at 12:16 PM.
  Reply With Quote
Old November 8th, 2018, 01:12 PM   #6
bulletin blues
Lifetime Supporting Member
United States

bulletin blues is offline
 
bulletin blues's Avatar
 
Join Date: Mar 2003
Location: out there
Posts: 177
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”.
__________________
_____
  Reply With Quote
Old November 8th, 2018, 01:40 PM   #7
cassidy387
Member
Thailand

cassidy387 is offline
 
Join Date: Nov 2018
Location: BKK
Posts: 13
Quote:
Originally Posted by bulletin blues View Post
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 by cassidy387; November 8th, 2018 at 01:51 PM.
  Reply With Quote
Old November 8th, 2018, 02:08 PM   #8
bulletin blues
Lifetime Supporting Member
United States

bulletin blues is offline
 
bulletin blues's Avatar
 
Join Date: Mar 2003
Location: out there
Posts: 177
Are any errors showing up in the log viewer while you try running the script?
__________________
_____
  Reply With Quote
Old November 8th, 2018, 02:14 PM   #9
cassidy387
Member
Thailand

cassidy387 is offline
 
Join Date: Nov 2018
Location: BKK
Posts: 13
Quote:
Originally Posted by bulletin blues View Post
Are any errors showing up in the log viewer while you try running the script?
I click connected button again to refresh the log viewer but it's the same problem nothing new.

action script
#LogViewerCtrl1.HostName = "localhost";
#LogViewerCtrl1.Refresh();
  Reply With Quote
Old November 8th, 2018, 02:31 PM   #10
bulletin blues
Lifetime Supporting Member
United States

bulletin blues is offline
 
bulletin blues's Avatar
 
Join Date: Mar 2003
Location: out there
Posts: 177
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?
__________________
_____
  Reply With Quote
Old November 8th, 2018, 02:36 PM   #11
bulletin blues
Lifetime Supporting Member
United States

bulletin blues is offline
 
bulletin blues's Avatar
 
Join Date: Mar 2003
Location: out there
Posts: 177
LogMessage(“the connection script is running”);

Forgot the end quotes.
__________________
_____
  Reply With Quote
Old November 8th, 2018, 02:37 PM   #12
cassidy387
Member
Thailand

cassidy387 is offline
 
Join Date: Nov 2018
Location: BKK
Posts: 13
Quote:
Originally Posted by bulletin blues View Post
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.
  Reply With Quote
Old November 8th, 2018, 02:40 PM   #13
cassidy387
Member
Thailand

cassidy387 is offline
 
Join Date: Nov 2018
Location: BKK
Posts: 13
like this https://www.img.in.th/image/BtfpxT
  Reply With Quote
Old November 8th, 2018, 02:49 PM   #14
bulletin blues
Lifetime Supporting Member
United States

bulletin blues is offline
 
bulletin blues's Avatar
 
Join Date: Mar 2003
Location: out there
Posts: 177
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.
__________________
_____
  Reply With Quote
Old November 8th, 2018, 02:59 PM   #15
cassidy387
Member
Thailand

cassidy387 is offline
 
Join Date: Nov 2018
Location: BKK
Posts: 13
Quote:
Originally Posted by bulletin blues View Post
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?
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Cannot Access MS SQL Server to Intouch Jerry321 LIVE PLC Questions And Answers 4 December 11th, 2017 10:04 PM
Wonderware Intouch SQL Access Manager tgulch LIVE PLC Questions And Answers 0 September 7th, 2017 01:54 PM
InTouch Access Name - port forwarding ctrlboy LIVE PLC Questions And Answers 1 October 4th, 2012 02:15 AM
Perform a SQL job through InTouch dash LIVE PLC Questions And Answers 0 July 1st, 2011 03:09 PM
Wonderware / SQL Reporting Server I I L LIVE PLC Questions And Answers 3 May 20th, 2009 07:43 PM


All times are GMT -5. The time now is 11:29 AM.


.