Help please to get my head around this...
Need to test database connection status prior to inserting/updating content.
I have the following code in a test button.
Code: Select all
on mouseUp
/* --------------------------------
Test for DB connection
--------------------------------- */
if revopenDatabases() <> empty then
wait 1 sec
revclosedatabase gConID
wait 1 sec
#run SQL
put empty into dbError
put "select noteddID from Notes" into tSQL
put revQueryDatabase(gConID,tSQL) into rsID
handleRevDBerror the result
if number of words of dbError = 1 then
put "# of records in Notes:" && revNumberOfRecords(rsID) into fld "tDatabase"
put the result into tResult
handleRevDBerror tResult
else
put "resource id of open dbs:" && revopenDatabases() &cr&cr& dbError into fld "tDatabase"
end if
else
answer "No Database is open"
exit mouseUp
end if
end mouseUp
Code: Select all
wait 1 sec
revclosedatabase gConID
wait 1 sec
Code: Select all
put revQueryDatabase(gConID,tSQL) into rsID
kotikoti.