I am trying to run a command in my VB6, but I've got this error message, hope somebody can help, thanks....
Dim oConn As New ADODB.Connection
Dim oComm As New ADODB.Command
Dim oRS As New ADODB.Recordset
oConn.ConnectionString = "Provider=IBMDA400.DataSource.1;Password=pwd;Persi st Security Info=True;User ID=UID;Data Source=999.999.999.999"
oConn.CursorLocation = adUseClient
oConn.Open
oComm.ActiveConnection = oConn
oComm.CommandText = "strqmqry qmqry(lib/wrkqry) alwqrydfn(*yes) qmform(*qmqry)"
oRS.Open oComm
SQL0104: Token STRQMQRY was not valid. Valid tokens: ( END SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN.
Cause . . . . . : A syntax error was detected at token STRQMQRY. Token STRQMQRY is not a valid token. A partial list of valid tokens is ( END SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN. This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: -- Verify the SQL statement in the area of the token STRQMQRY. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. -- If the error token is <END-OF-STATEMENT>, correct the SQL statement because it does not end with a valid clause.
Any idea?
Thanks a lot!
Dim oConn As New ADODB.Connection
Dim oComm As New ADODB.Command
Dim oRS As New ADODB.Recordset
oConn.ConnectionString = "Provider=IBMDA400.DataSource.1;Password=pwd;Persi st Security Info=True;User ID=UID;Data Source=999.999.999.999"
oConn.CursorLocation = adUseClient
oConn.Open
oComm.ActiveConnection = oConn
oComm.CommandText = "strqmqry qmqry(lib/wrkqry) alwqrydfn(*yes) qmform(*qmqry)"
oRS.Open oComm
SQL0104: Token STRQMQRY was not valid. Valid tokens: ( END SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN.
Cause . . . . . : A syntax error was detected at token STRQMQRY. Token STRQMQRY is not a valid token. A partial list of valid tokens is ( END SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER BEGIN. This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: -- Verify the SQL statement in the area of the token STRQMQRY. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. -- If the error token is <END-OF-STATEMENT>, correct the SQL statement because it does not end with a valid clause.
Any idea?
Thanks a lot!
Comment