Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    An index thing (97)

    I am opening a recordset from a table and trying to set the index of the recordset and then go to the first record.

    Set rst = dbs.OpenRecordset("tblRates", dbOpenDynaset)
    rst.Index = "SYM" ' . . . . . . . < = = = = = = = = = = = = ''KWVH this line tells me that "Operation is not supported for this type of object"
    rst.MoveFirst

    The second line shows that the operation is not supported. The tblRates has two indices, Pkey (Unique) and SYM(not unique). Is this another openDynaset vs Opentable thing?

    Any help is greatly appreciated.

    Ken

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: An index thing (97)

    You must have worked with xbase databases. In Access, the indexes are always set and you don't have any control over which ones you use. If you want a different sort from the default, create a query and set the sort the way you wish and then open the recordset on that query instead of on the table.
    Charlotte

  3. #3
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: An index thing (97)

    Charlotte,

    WOW! So how do I know what the default sort of the recordset is? I need to go through the records in a specific order, which coincidently is the order of one of the two indices.

    How would I open the query, using the following example?

    Set rst = dbs.OpenRecordset("tblRates", dbOpenDynaset)


    Thanks tons for your help.

    Ken

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: An index thing (97)

    Dim strSQL as String

    strSQL = "SELECT * FROM tblRates ORDER BY SYM"

    Set rst = dbs.OpenRecordset(strSQL, dbOpenDynaset)
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Jan 2003
    Location
    Central Florida, USA
    Posts
    505
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: An index thing (97)

    Charlotte,

    duh, sorry. Had tunnel vision and a bf at the same time.

    thanks!

    Ke

Posting Permissions

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