Re: Sort order in PocketAccess with PPC 2003_Phone edition



Hi,

I don't know if this is your problem, but when you retrieve RecordCount from
a recordset, I believe the cursor is at the end of the recordset. I would
suggest you try:

Main.rs.Open "SELECT * FROM Tbl_1 ORDER BY Txt", Main.cn
Main.rs.MoveFirst
Do Until Main.rs.EOF
frmkat.Ansl.AddItem (Main.rs.Fields(1).value)
Main.rs.MoveNext
Loop
Main.rs.close

and

Main.rs.Open "SELECT * FROM Tbl_1 WHERE Txt=' " _
& frmkat.Ansl.List(frmkat.Ansl.ListIndex) & "'", Main.cn
Main.rs.MoveFirst
Do Until Main.rs.EOF
frmkat.IDkokansl.text = CStr(Main.rs.Fields("ID").value)
Main.rs.MoveNext
Loop
Main.rs.Close

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"Freddie70" <fredrik.stahle@xxxxxxxxxxxx> wrote in message
news:1141296990.813425.266290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a problem with the sort order when running the comman "ORDER BY"
in a Pocket Access database.

I have a database MYDB.cdb that's include a table ("Tbl_1") with two
columns ("ID", "Txt")
In my app (written in eVb) i run the following:

Main.rs.Open "SELECT * FROM Tbl_1 ORDER BY Txt", Main.cn
Main.rs.MoveFirst
For i = 1 To Main.rs.RecordCount
frmkat.Ansl.AddItem (Main.rs.Fields(1).value)
Main.rs.MoveNext
Next i
Main.rs.close

The data in column "Txt" is text in swedish (includes the letters "Å",
"Ä", "Ö").
When i run the above in a HP 5550 with PPC 2003 the sort order is
correct that means the letter "A" is sorted before the letters "Å" and
"Ä".
In a HP 6515 with PPC 2003 Phone_Edition the sort order is incorrect,
letters "Å" and "Ä" is sorted before "A".

The main problem occurs after I have populated the combobox ("Ansl").
When selecting a new item in "Ansl" i run the following (and gets a EOF
error for items incl. "Å","Ä" and "Ö")

Main.rs.Open "SELECT * FROM Tbl_1 WHERE Txt=' " &
frmkat.Ansl.List(frmkat.Ansl.ListIndex) & "'", Main.cn
Main.rs.MoveFirst
For i = 1 To Main.rs.RecordCount
frmkat.IDkokansl.text = CStr(Main.rs.Fields("ID").value)
Next i
Main.rs.Close

Any ideas what might be the problem?


.



Relevant Pages

  • Sorting Order Changes from Running Macro
    ... I read a table generated by a query into a recordset using the following code: ... Set dbs = CurrentDb ... The output table is NOT in the same order as input data from myQuery. ... Is there any way to make Access mainatain the sort order? ...
    (microsoft.public.access.modulesdaovba)
  • Re: open recordset sort order
    ... The trick is to use an SQL query rather than the table itself in the ... recordset definition, and do the sorting in the query, e.g. ... set rst = CurrentDb.OpenRecordset ... > this sort order so I can loop through the record set based ...
    (microsoft.public.access.modulesdaovba)
  • Sort order in PocketAccess with PPC 2003_Phone edition
    ... I have a problem with the sort order when running the comman "ORDER BY" ... in a Pocket Access database. ... In a HP 6515 with PPC 2003 Phone_Edition the sort order is incorrect, ...
    (microsoft.public.pocketpc.developer)