DBGateway_Select

4D - Documentation   Français   English   German   4D For ADO, Command Theme List   4D For ADO, Command Alphabetical List   Back   Previous   Next

version 2004


DBGateway_Select (connID; sqlQuery) Longint

ParameterTypeDescription
connIDLongintConnection ID returned by DBGateway_Connect
sqlQueryTextSQL Query (SELECT..., SHOW..., DESCRIBE...)
Function resultLongintSelect 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

4D - Documentation   Français   English   German   4D For ADO, Command Theme List   4D For ADO, Command Alphabetical List   Back   Previous   Next