ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Sql0104

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sql0104

    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!

  • #2
    Re: Sql0104

    oComm.CommandText = "strqmqry qmqry(lib/wrkqry) alwqrydfn(*yes) qmform(*qmqry)"
    Do you not need the library?
    Code:
    oComm.CommandText = "qsys/strqmqry qmqry(lib/wrkqry) alwqrydfn(*yes) qmform(*qmqry)"
    Regards

    Kit
    http://www.ecofitonline.com
    DeskfIT - ChangefIT - XrefIT
    ___________________________________
    There are only 3 kinds of people -
    Those that can count and those that can't.

    Comment

    Working...
    X