M
Marco
Hi
in a project I'm developing I linked AS400 table. I try to execute the
following code
Set cmd = New ADODB.Command
cmd.ActiveConnection = Application.CurrentProject.Connection
cmd.CommandText = " SELECT DATALIB_TPRZT00F.ZCDTIT AS [Codice Titolo] " & _
" FROM DATALIB_TPRZT00F " & _
" WHERE (((DATALIB_TPRZT00F.ZCDTIT) Like '*20001400')) "
Set rst = cmd.Execute
Debug.Print rst(0)
but I got the following error "Current record corresponds to the beginning
or to the end of file or it was deleted. To execute the operation required it
is necessary to have a current record" when I execute the last statement.
If I try to execute the same query by query windows it works fine.
Can anyone tell me what could be the problem?
TIA
Marco
in a project I'm developing I linked AS400 table. I try to execute the
following code
Set cmd = New ADODB.Command
cmd.ActiveConnection = Application.CurrentProject.Connection
cmd.CommandText = " SELECT DATALIB_TPRZT00F.ZCDTIT AS [Codice Titolo] " & _
" FROM DATALIB_TPRZT00F " & _
" WHERE (((DATALIB_TPRZT00F.ZCDTIT) Like '*20001400')) "
Set rst = cmd.Execute
Debug.Print rst(0)
but I got the following error "Current record corresponds to the beginning
or to the end of file or it was deleted. To execute the operation required it
is necessary to have a current record" when I execute the last statement.
If I try to execute the same query by query windows it works fine.
Can anyone tell me what could be the problem?
TIA
Marco