Download PDF manual - Macro Scheduler
Transcript
61
Macro Scheduler
For more advanced database manipulation use VBScript. See:
http://www.mjtnet.com/blog/2006/02/20/accessing-databases/
Abbreviation: DBE
See also: DBConnect
60 ,
DBClose
59 ,
DBQuery
61
Example
Let>str=Driver={MySQL ODBC 3.51
Driver};Server=someserver.com;Port=3306;Database=example;User=admin;Password=xxxx;O
ption=3;
DBConnect>str,dbH
Let>SQL=delete from mytable where ID=1234
DBExec>dbH,SQL,result
DBClose>dbH
4.4.4
DBQuery
Not supported in Macro Scheduler Lite.
DBQuery>database_reference,SQL_Statement,recordset_array,num_recs,num_fields[,fieldn
ames]
Use DBQuery to perform a SQL query which returns a recordset, such as a SELECT statement.
database_reference is a reference variable returned by a previous call to DBConnect. Specify the
SQL statement in SQL_Statement.
Specify a variable name in recordset_array in which to return the recordset. The array is constructed
in the format recordset_rownum_fieldnum. So a recordset with 2 rows and 3 fields per row would
create an array as follows:
variablename_1_1
variablename_1_2
variablename_1_3
variablename_2_1
variablename_2_2
variablename_2_3
Specify variables for num_recs and num_fields to store the number of records and number of fields
returned in the recordset.
Optionally set fieldnames to 1 to return the names of the fields rather than the index. This would
return an array like:
variablename_1_FIELD1
variablename_1_FIELD2
variablename_1_FIELD3
variablename_2_FIELD1
variablename_3_FIELD2
variablename_3_FIELD3
Where FIELD1, FIELD2, FIELD3 were the actual field names of the fields returned.
© 2015 MJT Net Ltd
Related documents