QueryOpenADO

Top  Previous  Next

Prototype

 

IntTableHandle:=QueryOpenADO(strDataBaseName,strSQL,strUser,strPassword)

 

Description

 

It makes a SQL query on a database using a ADO (OLE DB) database connection.

 

Parameters

 

StrDataBaseName: string corresponding to the .UDL file. (universal data link), containing all connection parameters, or connection string with all parameters.

 

StrSQL: string corresponding to the SQL text with the query to execute.

 

StrUser: user name for database log-in

 

StrPassword: password for database log-in

 

Returned value

 

IntTableHandle: integer value corresponding to the handle of the virtual table returned from query.

 

Notes

 

Database and table must exist.

 

The returned value can be used with the functions operating on tables  (TableClose, TableRecordCount, TableFirst,…).

 

In strSQL be careful to apostrophe (') and inverted commas (").

 

Example

 

// It stores query handle

OneTable:= QueryOpenADO('test_ado.udl','select * from statistics','','');

 

// Executes other operations...

 

// Closes the virtual table of the query

TableClose(OneTable);