Uselsx "*LSXODBC"
Sub Initialize
Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
Dim firstName As String
Dim lastName As String
Dim msg As String
Set qry.Connection = con
Set result.Query = qry
con.ConnectTo("ATDB")
qry.SQL = "SELECT * FROM GETSCALE"
result.Execute
If result.FieldExpectedDataType(2, _
DB_LONG) <> DB_LONG Then
Messagebox _
"Data type wrong for field 2",, "Bad data type"
Exit Sub
End If
If result.FieldExpectedDataType(3, DB_LONG) <> DB_LONG Then
Messagebox "Data type wrong for field 2",, _
"Bad data type"
Exit Sub
End If
If result.FieldExpectedDataType(4, DB_LONG) <> DB_LONG Then
Messagebox "Data type wrong for field 2",, _
"Bad data type"
Exit Sub
End If
msg = "Getscale data:" & Chr(10)
Do
result.NextRow
msg = msg & Chr(10)
For i = 1 To result.NumColumns
msg = msg & " " & result.GetValue(i)
Next
Loop Until result.IsEndOfData
Messagebox msg,, "Getscale Data"
con.Disconnect
End Sub