SQL Object
 
Syntax
 
Success = SQL.RunRecordsetSite(SiteOrKeyID, Query, Records)
 
Note: Only available in CCL Programming language for CBBS/32 Web Server
 
Description
Executes a SELECT query on a named database connection from the server's Databases registry (the Databases tab of the CBBS/32 WebServer Configuration), independent of the current session connection, and returns the result as a disconnected read-only recordset.
 
The connection is looked up by its connection name (KeyID) or by its database name, case-insensitive. Exactly one registry entry must match: when two entries share the same database name, a lookup by that database name is ambiguous and the function returns False. A temporary connection is opened with the credentials managed in the server configuration; after the query completes the recordset is detached and the connection is closed again, so the returned recordset remains fully usable on its own.
 
This makes it possible for a script running on one session connection (for instance the central GENERAL connection) to read data from another site's database without maintaining its own logins, connection strings or configuration tables. The method was introduced for the Ask Tradium IQ role resolution, but is generic.
 
Parameter
Description
SiteOrKeyID
The connection name (KeyID) or database name of the target connection, as defined on the Databases tab of the server configuration. Case-insensitive; must match exactly one entry.
Query
The SELECT query to execute on the target database.
Records
The ADODB record set with the result. If it refers to an opened recordset, it will first be closed and the object reinitialized. On failure the recordset is not usable; always test the return value.
(return value)
Boolean. True when the query executed successfully; False when the name is unknown or ambiguous, or when a connection or query error occurred. No error dialog is ever shown; the caller decides how to fall back.
 
Remarks
The recordset is opened client-side as a static, read-only cursor (adUseClient / adOpenStatic / adLockReadOnly) and is detached from the connection before the function returns. It can therefore be read and scrolled freely, but not updated.
 
The temporary connection uses a connection timeout of 5 seconds and a command timeout of 10 seconds. An unreachable server therefore costs at most a few seconds and results in False, never in a hanging request or an error dialog. Connection failures do not affect the session connection.
 
Available as of CBBS/32 WebServer version 12.0.59 (August 2026). On older versions the method does not exist; scripts that must run on both should guard the call with an error handler and provide a fallback.
 
 
 
See Also
RunRecordset, other SQL.RunQueryxxxxxxxx functions, ADODB.Recordset.
Example
Sub Main()
 
    Dim rsRec As ADODB.Recordset
 
    SQL.RunRecordset "Parameters", rsRec
 
    Do While Not rsRec.Eof
        Debug.Print rsRec(0), rsRec(1)
        rsRec.MoveNext
    Loop
 
    Set RsRec = Nothing
 
End Sub
 
' Excel bestand uitlezen
Sub Main()
 
    Dim rsRec As ADODB.Recordset
 
    SQL.RunRecordset "c:\mijn documenten\prijslijst.xls::Blad1", rsRec
 
    Do While Not rsRec.Eof
        Debug.Print rsRec(0), rsRec(1)
        rsRec.MoveNext
    Loop
 
    Set RsRec = Nothing
 
End Sub