I’m trying to query Movex via Lotus Notes / Lotus Script using ODBC. My question is how to I build the query, . . do I use the movex table name or movex library name or a combination. Below is my code. Any help would be greatly appreciated
Dim con As ODBCConnection
Dim qry As ODBCQuery
Dim result As ODBCResultSet
Dim defaultQuery As String
Set con = New ODBCConnection
Set qry = New ODBCQuery
Set result = New ODBCResultSet
Set qry.Connection = con
Set result.Query = qry
status = con.ConnectTo(“PPUS29”, “USERNAME”, “PASSWORD”)
If status Then
Msgbox "Connected to " & con.DataSourceName,, "Connection made ..."
defaultQuery =|SELECT OAORNO, OAORST, OAORSL FROM OOHEAD WHERE OAORNO ='0008989766'|
Messagebox defaultQuery, ,"SQL Query"
qry.SQL = defaultQuery
result.Execute
If result.IsResultSetAvailable Then
Messagebox "Got result set"
msg = "Results "
Do
result.NextRow
msg = msg & Chr(10)
For i = 1 To result.NumColumns
msg = msg & " " & result.GetValue(i)
Next
Loop Until result.IsEndOfData
Msgbox msg
Else
Messagebox "Cannot get result set"
Exit Sub
End If
Else
Msgbox "Unable to connect"
End If