Indusoft

Dim sql
sql = "CREATE Table MyTable (TS datetime, C1 Int, C2 Text)"
$DBExecute("DB", sql)

Dim sql
$DBCursorClose($numCur)
sql = "SELECT * FROM Table_1"
If $Condition<>"" Then sql = sql & " WHERE " & $Condition
$Status=""
$numCur = $DBCursorOpenSQL("DB", sql,"", "Status")
$NumRows = $DBCursorRowCount($numCur)
$row = 1
$C1 = $DBCursorGetValue($numCur, "C1")
$C2 = $DBCursorGetValue($numCur, "C2")

NEXT command:
$DBCursorNext($numCur, "Status")
$C1 = $DBCursorGetValue($numCur, "C1")
$C2 = $DBCursorGetValue($numCur, "C2")
If $row<$NumRows Then $row = $row+1


Dim sql, numRows, row, numCur, msg
sql = "SELECT * FROM MyTable"
numCur = $DBCursorOpenSQL("DB", sql)
numRows = $DBCursorRowCount(numCur)
For row=1 To numRows
msg = msg & vbCrLf & $DBCursorGetValue(numCur, "TS")
msg = msg & vbTab & $DBCursorGetValue(numCur, "C1")
msg = msg & vbTab & $DBCursorGetValue(numCur, "C2")
$DBCursorNext(numCur)
Next
$DBCursorClose(numCur)
MsgBox msg, vbOKOnly, "Database records"


Dim sql
sql = "DELETE FROM MyTable"
sql = sql & " WHERE TS=#" & $TSGrid & "#"
$DBExecute("DB", sql)
$GridReload = $GridReload+1



Dim res
res = MsgBox($Ext("Are you sure you want to Exit the Application?"), vbYesNo + vbQuestion, $Ext("Exit Application"))
If res=vbYes Then $Shutdown()

$TSEdit = $Date & " " & $Time

$UpdateTrigger = $UpdateTrigger+1

$GridReload = $GridReload+1


$Open($#ScreenName:"Home")
$Close("menu")
Comments