Dim retcode as Variant
Dim query as String
Dim outputStr as String
'' The following will open the datasource SBLTESTW and execute the query
'' specified by query and return the results in destination
''query = "select * from class"
retcode = SQLRequest("DSN=SBLTESTW;UID=DBA;PWD=SQL",query,outputStr,prompt,0,destination())
End Sub
SQLRetrieve 功能函數
在由connection指定的連接上獲取待定查詢結果并將結果返回到destination()數組里。
SQLRetrieve( connection& , destination() , maxColumns% , maxRows% , columnNames% , rowNumbers% , fetchFirst% )
語法:
參 數 解 釋
connection& 長型long
destination() 2維變量數組
maxColumns% 整形,可選參數,用來指定在查詢中取回的欄列數目
maxRows% 整形,可選參數,用來指定在查詢中取回的行的數目
columnNames% 整形,可選參數,默認為0
rowNumbers% 整形,可選參數,默認為0
fetchFirst% 整形,可選參數,默認為0
注解:
返回值是結果集的行的數目或請求的最大行。如果函數不能在指定連接上獲得結果,返回-1。如果沒有發現數據,函數返回0。
文章來源于領測軟件測試網 http://www.kjueaiud.com/