Pelle
02-22-2007, 02:23 PM
I have a very basic sql server 2005 db. I have a single table with two columns. The primary key column called "Col_ID" of course contains unique identifiers, in my case number from 1, 2, 3 and so on...
I use this code to retrieve my recordset and it works ok in Access 2003 but not now when I have migrated to sql2005.
Set rs = server.CreateObject("ADODB.recordset")
SQL = "SELECT * FROM MyTable ORDER BY Col_ID ASC"
rs.open SQL, con
Then this output is generated when I loop through the rs:
1 10 11 12 2 3 4 5 6 8 9
As you can see the computer believes that 10 is less than 9. I don't agree about that opinion. I want the system to output 123456789, 10, 11..well you know the rest..
Question of course. Which SQL query will make the database to understand that 10 and 11 come after 9 and not before?
Hope you can help me out.
I use this code to retrieve my recordset and it works ok in Access 2003 but not now when I have migrated to sql2005.
Set rs = server.CreateObject("ADODB.recordset")
SQL = "SELECT * FROM MyTable ORDER BY Col_ID ASC"
rs.open SQL, con
Then this output is generated when I loop through the rs:
1 10 11 12 2 3 4 5 6 8 9
As you can see the computer believes that 10 is less than 9. I don't agree about that opinion. I want the system to output 123456789, 10, 11..well you know the rest..
Question of course. Which SQL query will make the database to understand that 10 and 11 come after 9 and not before?
Hope you can help me out.