lunenburger
Member
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 to link another table to that data.
On a similar system, I was using AdvancedHMI and used this VB.Net code:
and that was working perfectly.....
But I can't find a way to do it with VbScript...
I can find the total number of rows, and as long as nothing gets deleted I am using this code:
But if the number of rows changes, that won't work...
Any insight would be greatly appreciated
Immediately after inserting a row, I need to know what that row number is to link another table to that data.
On a similar system, I was using AdvancedHMI and used this VB.Net code:
Code:
Try
MysqlConn.Open()
COMMAND.CommandText = "SELECT Last_insert_id()"
Dim RunKey = COMMAND.ExecuteScalar()
TempRunKeyID = RunKey
and that was working perfectly.....
But I can't find a way to do it with VbScript...
I can find the total number of rows, and as long as nothing gets deleted I am using this code:
Code:
'Find Row Number of current Job
Dim sql1
sql1="Select * FROM meererdb.run_summary"
$numCur=$DBCursorOpenSQL("MySqlDB",sql1)
$rownum=$DBCursorRowCount($numCur)
sql1.close
sql1=Nothing
Any insight would be greatly appreciated