Results 1 to 4 of 4

Thread: SELECT statement and ORDER BY clause

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    17
    HI,

    I have some problems with this:

    rs.Open "SELECT * " & _
    "FROM M_INDICA ", _
    "ORDER BY p_indica_gen", _
    cn_OLAP, adOpenDynamic, adLockOptimistic

    I always get this error : type mismatch

    Can you help me!
    Martin Nadeau, B.Sc.A.
    Centre de recherche en géomatique
    Université Laval

  2. #2
    Hyperactive Member
    Join Date
    Oct 2000
    Posts
    400
    Make sure the field is not a logical, (Yes/No, boolean, etc), Memo, or Image type.

  3. #3
    Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    52
    You can't split your sql string up that way. Either use example 1 or put all the sql string on one line as in example 2


    (1)
    Dim sql as String
    sql = "SELECT * "
    sql = sql & "FROM M_INDICA "
    sql = sql & "ORDER BY p_indica_gen"
    rs.Open sql, _
    cn_OLAP, adOpenDynamic, adLockOptimistic

    (2)
    rs.Open "SELECT * FROM M_INDICA ORDER BY p_indica_gen", _
    cn_OLAP, adOpenDynamic, adLockOptimistic


  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    17

    Select statement and Odrder By Clause

    Thanks for your help! It was just a big mistake! I just replaced the comma with & in this line:

    "FROM M_INDICA ", _

    Thanks again!



Posting Permissions

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



Click Here to Expand Forum to Full Width