Insert/Update data into tables in SQL Server Express via FTView SE

you must make sure the data types are correct.
You need to format the Date

Dim My_Date as variant
My_date = "'" + Format(Date,"yyyy-mm-dd") + "'"
Dim My_Tag1, My_Tag2 as integer (note it depends on types)
Then your variables need to be the same i.e. string, integer etc. unless you have made them all strings
I also suggest you copy the PLC values to variables
My_Tag1 = PLC_Tag1
My_Tag2 = PLC_Tag2

datastring = "INSERT INTO TBL_YYY (AAA, BBB, CCC) VALUES (" & My_Date & ", " & My_Tag1 & ", " & My_Tag22 & " ) "

Conn1.Open
Conn1.Execute datastring
Conn1.Close

Note there are spaces between the " & yours does not show the spaces these are important, also I have incorporated it all into the datastring then you execute it As I said the string has to be absolutely right
 
No....
MsgBox("FFP") show a message box normally with FFP but MsgBox(FFP) shows a empty box but without error

I guess that BD_SETPOINTs tags must be referenced in vba "joined" with PLC tags.
That's what I have to do and I don't know how
 
Last edited:
look at the links I sent. you need to add


Code:
Set Ogroup = Application.CreateTagGroup(Me.AreaName)


or summat like that, before the first .Add
 
I have not used FT but in the older RSV32 logging to databases was easy, just triggers to log data, however, I think update command was not one of the commands so would have to use VB.
 
First, your Group.Add item should be in braces:


Group.Add "{[IOTOPIC]TagName}"


Also, when reading an item, use Set:


Set MyTag = Group.Item("{[IOTOPIC]TagName}")
 
Not sure if this helps but in excel this is typical problem.
An automation error could occur when you are referring to a workbook or worksheet via a variable, but the variable is no longer active. Make sure any object variables that you are referring to in your code are still valid when you call the property and methods that you are controlling them with.
Can you set break points in the VB & step through it to find which one is causing the error ?.
 

Similar Topics

I'm new to ST so go easy. Studio 5000 L33ER PLC I'm trying to take 2 strings, merge them into 1 string. with a space between the 2 strings...
Replies
3
Views
2,245
Hello everyone. Currently I am using Eplan p8 and faced (while creating a panel) with a challenge in finding a device called DIN mounting rail...
Replies
10
Views
3,373
Hello guys, I am working with a CompactLogix, which communicates over Ethernet/IP with a pin marker. Basically, The PLC sends the texts to be...
Replies
6
Views
1,379
Hi, I have some remote IO connected to my S7-317-2 PN/DP system. I have 1 particular profinet remote IO which is not important to the system, and...
Replies
9
Views
2,979
I am using VbScript in Indusoft to insert data into a MySql database. Immediately after inserting a row, I need to know what that row number is...
Replies
24
Views
5,276
Back
Top Bottom