version 2004
DBGateway_Select (connID; sqlQuery) Longint
| Parameter | Type | Description | |
| connID | Longint | Connection ID returned by DBGateway_Connect | |
| sqlQuery | Text | SQL Query (SELECT..., SHOW..., DESCRIBE...) | |
| Function result | Longint | Select ID that is used by selection-related methods |
Description
The DBGateway_Select command handles SQL statements that return data (such as "SELECT * FROM myTable"). It returns a Longint representing the resultant data set.
connID is a Longint returned by DB_Gateway_Connect.
sqlQuery is a Text variable that contains the SQL statement.
Example
$connectStr:="Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)}; DBQ=c:\home\biblio.mdb"
connID:=DBGateway_Connect("192.168.0.12" ; $connectStr )
If(connID#0)
selID:=DBGateway_Select("SELECT * FROM myTable ")
If(SelID#0)
`Successful, handle your resultant data set here
...
DBGateway_CloseSelect(selID)
Else
ALERT(DBGateway_ErrorString(connID))
End if
DBGateway_Close(connID)
Else
ALERT("Connection failed")
End if