|
-
Jun 3rd, 2002, 06:09 PM
#1
DBGrid & Data Collection question
Hi everyone. I have a question that's been bugging me and I can't find much on how to resolve it.
I have a Data collection (object) linked with a DBGrid object accessing a database. (Note: I'm having to modify someone else's code to do this, too.) The code is a simple SQL statement, such as:
DBData.RecordSource = "Select * from TABLE where ID = " & ID
DBData.Refresh
This data is put into the attached DBGrid, with no real problems. I'm not sure exactly how it works, but it appears that the latest additions are placed last. What I want to do is reverse the order of the list, so what used to be at the bottom of the DBGrid should be at the top.
I have tried the statement:
DBData.RecordSource = "Select * from TABLE where ID = " & ID & " ORDER by 'PRIMARY KEY' DESC"
but that doesn't seem to do anything.
I don't think I can do this by SQL, that I know of, since I don't know how it's sorting it, or what it's sorting by. Is there a command that will let me reverse the order of the data for either the Data collection or the DBGrid?
Any help is greatly appreciated. 
Destined
Edit: Oh, I figured out that 'PRIMARY KEY' doesn't seem to work. I should also point out that I don't have access to the database itself, so I can't really open it and see what the name of the primary key is.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|