![]() |
Index in a table
How do I create an index to sort a table?! I have created an index using Database desktop, which is what I used to create the tables. However when I add a new record it then tells me that the index is out of date.
If you've read in my other post in the Working projects forum you'll know that I need to sort clock in/ out records so that when searching it will come to the newest first. |
Don't make me want to install Delphi, now :D.
|
Quote:
GJ, are you using some weird Delphi controls to interface with the database, or are you using SQL connectors? What database are you using, anyway? |
Hmmm...I'm using sql to update and add records on the clock in thingy. But to access the table data I'm placing the delphi TTable things on the page and then using things like table1.open, table1.next etc to search through them and stuff.
the databases are paradox 7...don't know why..thats just what the teacher told us to use at college. |
Damn... I cannot for the life of me remember how to work databases in Delphi...
|
Sokay...I have yet again recided to think of another way to clock in without sorting them and I think I've found a way that's simple and that works. I'll post it when I've tested it n stuff.
|
Glad to hear it.
|
WOOOHOOO!!! Ok, this works! :D I've tried all possible cases and it works! :D
I took your idea into acount Ooble, and had a field called Active in the shift table. When no active shift is found for that employee it creates a record and sets the active field to true. Then when searching again it finds the true value and clocks it out! :D This is so much simpler than what I was trying to do before! lol :
procedure Tfrm_clock_In.btn_enterClick(Sender: TObject); |
Congrats, mate. That reminds me... I really should get on with my Year 13 coursework...
|
Tried and tested and it works perfectly! I had to add a shift_ID field to the shift table so that the sql didn't update every field when clocking out.
Really though...Ooble, are you like a child prodigy? When did you start programming? You're miles ahead of me and we're in the same year! lol. |
| All times are GMT -5. The time now is 9:34 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC