關鍵字:SQA Basic 數據庫命令
SQLRequest功能函數
建立一個由connectionStr指定數據源的連接,執行包含在query內的SQL語句,返回請求的結果到ref()數組里,并關閉連接。
SQLRequest( connectionStr$ , query$ , outputStr$ , prompt% , columnNames% , ref() )
語法: 參數 解釋
connectionStr$ 必需項。
query$ 必需項
outputStr$ 包含完整連接字符串。
prompt% Prompt指定何時驅動對話框出現。一個整數。(查看SQLOpen).
columnNames% 0或非0的一個整數。當columnNames為非0,欄列名稱作為ref()數組的第一行被返回。如果columnNames缺省,默認值為0。
ref() 必需項,2維變量數組。
注解:
在連接不能被建立、查詢不能用、或其它錯誤的情況下,返回一個負數。在請求成功情況下返回正數或受影響的行數。其它SQL語句返回0。
參數是必需的參數。結果為變量。
SQLRequest Example
This example will open the datasource SBLTESTW and execute the query specified by query and return the results in destination
Sub main
'''' Declarations
''''
Dim destination(1 To 50, 1 To 125) As Variant
原文轉自:http://www.anti-gravitydesign.com