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
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