Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: what is the constant for using a query in rs.open method?

    what is the constant for using a query in rs.open method?

    Rs.open MyQry,,,,,adCmd?

    There is nothing adCmdQuery, can i used for table or stored proc??

    <~M

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    You have to declare it:

    DIM db as DataBase, mySQL as string, RecSet as RecordSet

    mySQL="SELECT * FROM myTable WHERE myField=Value ORDER BY thatField;"
    SET db= CurrentDB
    SET rs = db.OpenRecordset(mySQL, DB_OPEN_DYNASET)

    then you can use the rs Object now

  3. #3
    Join Date
    Oct 2003
    Posts
    311
    you misunderstood the ?

    I am using ado...


    Rs.open MyQry,,,,,adCmd?

    rs.open source ,,,,
    the source can be sql or a table name or a qry name. The last paramater takes a adcmdText, adcmdTable, adcmd.... Constant to tell what kind of source is being used. AdCmdText is for sql string, adcmdTable is if only a table name is supplied ,, WHAt is the constant for a query name? if no constant is supplied adcmdUnknown or something like that is used and its very inefficient. So what is the Ado constant for using a query as a source?

    M~

  4. #4
    Join Date
    Oct 2003
    Posts
    311
    Originally posted by mikezcg
    you misunderstood the ?

    I am using ado...


    Rs.open MyQry,,,,,adCmd?

    rs.open source ,,,,
    the source can be sql or a table name or a qry name. The last paramater takes a adcmdText, adcmdTable, adcmd.... Constant to tell what kind of source is being used. AdCmdText is for sql string, adcmdTable is if only a table name is supplied ,, WHAt is the constant for a query name? if no constant is supplied adcmdUnknown or something like that is used and its very inefficient. So what is the Ado constant for using a query as a source?

    M~

    adCmdTable !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •