Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ONE MORE DATABASE QUESTION

Status
Not open for further replies.

genoah

Programmer
Nov 1, 2001
24
0
0
US
When I view a record on one screen, then I change to another and search for a nother, it will tell me record not found. But if I restart the program and search for that record again its there. I think its the way I change indexs or the lack of changing them back. It like the program does not see the rest of the records only the one I am working on. Please help.:{)
 
Are you using the same dataset? Maybe you need to call query.First to go back to the top of the table before you search again. Are you using Locate for your search?

TealWren
 
I am using two databases. I have a database for customers and a database for invoices. When I use the invoice database, I search with findkey method. I have customer and invoice database information on this page. When I exit and go into the customer information page I search with the find key method. I am new to using Delphi and I am still learning. When I search on the customer page, I need to search by zipcode, customer name or customer number. I havent mastered the query so that I can query one of the three and display it on one page. Any help will be appreciated.
 
Hmmm... With FindKey you should set the IndexName for the dataset before you do a findkey. There's no reason I can think of that it wouldn't find your record, unless you're using the wrong indexname or the wrong table.

Good luck with it!
TealWren
 
I'm unsure as to what database you're using (I'm guessing Paradox or the like ?). If you're allowing the user to search on one of 3 entered fields (customer no., customer name or zipcode) - ensure that you have an index set up for each of these. Then when the user selects to run a search, ensure that the correct index has been set against the table component so that they are ordered by this field. Then when the user inputs a string to run a search on, you should be able to run the 'FindKey'/'GotoKey' syntax to locate the appropriate entry.
Hope that this might help.
Steve
 
That fixed it. I just added the database index before the call for the search and that fixed it. Thanks for all the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top