Hi,I am trying to connect to AS/400 and getting the following error:
LS:DO The requested operation cannot be completed because it requires the succesful execution of a query may fail. a query if the sql statement was in error. Closing the result set discards its data.
And my code:
Dim con As ODBCConnection
Dim qry As ODBCQuery
Dim Result As ODBCResultSet
Set con = New ODBCConnection
Set qry = New ODBCQuery
Set result = New ODBCResultSet
Set qry.Connection = con
Set result.Query = qry
Dim DCDORD As Integer
Dim div, ZCDORD As String
div=" "
ZCDORD=" "
con.ConnectTo "TEST","PER","PER"
sqlstr ="CALL AA00DI('" & div & "','" & ZCDORD & "')"
qry.SQL =sqlstr
If Not result.Execute Then
Messagebox result.GetExtendedErrorMessage,, _
result.GetErrorMessage
Exit Sub
End If
DCDORD=Result.GetValue(1)
Msgbox DCDORD
result.Close(DB_CLOSE)
con.Disconnect
Exit Sub
What is wrong?
please help…