Database.ADO.getData() This page was last modified over 30 day(s) ago and has 0 comment(s)


Back to Database.ADO Class Summary

Availability
Windows

Usage
mdm.Database.ADO.getData():Array

Parameters
None

Returns
An Array

Description
Returns the full query data to a 2 dimensional array. The first dimension contains the row number and the second dimension contains the field number.

Notes
A Query must first be executed with mdm.Database.ADO.runQuery()

Example Code
//Prompts the data in Row 1, Field 4:
mdm.Database.ADO.select("SELECT * FROM mytable")
var dataSet:Array = mdm.Database.ADO.getData();
mdm.Dialogs.prompt(dataSet[0][3])

//This example will display the entire contents of the specified table in a dialog prompt
var tableName:String = "myTable";
mdm.Database.ADO.select("SELECT * FROM "+tableName)
var dataSet:Array = mdm.Database.ADO.getData();
var myText = ""
for (i=0; i<dataSet.length; i++) {
    for (n=0; n<dataSet[0].length; n++) {
        myText += "FIELD"+(n+1)+" = "+dataSet[i][n]+", ";
    }
    myText += "\n";
}
mdm.Dialogs.prompt(myText);

mdm.Database.ADO Class Example Downloads
No Example Downloads Available


Registered Users must be logged in to 'MyAccount' to add a Comment - Log In Here
  After Logging In, Click Here to Refresh This Page