SQL Object
 
Syntax
 
SQL.RunQueryGet1Row(Query[, TimeOut])
 
Description
Performs a SELECT query and returns all fields from the first line of the result in an array variable.
 
This function is optimized for querying single-row queries; Even if a query has multiple lines, only the first line is retrieved and reported back.
 
Parameter
Description
Query
A reference to a SELECT query.
Timeout
Optional. The number of seconds in which the test must be completed. If not specified, the timeout is 30 seconds.
 
See Also
andere SQL.RunQueryxxxxxxxx functies.
Example
Sub Main()
 
    Dim sQuery As String, x As Integer
    Dim A() As Variant
 
    sQuery = "Select Bedrijfsnaam, Adres, Postcode, Woonplaats From Klanten WHERE Code = 'INTERN'"
 
    A() = SQL.RunQueryGet1Row(sQuery)
 
    Debug.Print A(0)   ' Bedrijfsnaam
    Debug.Print A(1)   ' Adres
    Debug.Print A(2)   ' Postcode
    Debug.Print A(3)   ' Woonplaats
 
End Sub