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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Master detail wtih ADOQuery

Status
Not open for further replies.

ghiebert

Technical User
Apr 7, 2005
6
CA
Delphi 7 Enterprise.
I am using 3 dbGrids, each connected to an ADOQuery.
dbGrid1) The ADOquery brings up a part number from the detail table, and from that I get an invoice number.
dbGrid2) The 2nd ADOQuery is passed the invoice number and shows the general purchase information for that transaction (header)
dbGrid3) The 3rd ADOQuery again receives the invoice number as a parameter, and goes to the detail table to extract more helpful information about the transaction.

Worked perfectly using Access and ADOtables, but now that I am using a much larger SQL based database and can't use tables, I am using only queries. Step 1 and 2 work perfectly. In step 3 the dbgrid shows the field headers but no data. The parameter is not being passed. It is as if the parameter cannot be passed to the third dbGrid. Is that true? If so, I do not know how to correct that.
 
If you are seeing the field headers and not using persistent fields, then it's safe to assume the grid is linked to the table. It sounds like there is no data that matched the query. You can verify by inspecting ADOQuery3.RecordCount.

Roo
Delphi Rules!
 
It is exactly as you say, the field titles show but no result, so I'll check the count for starters.
I find Pervasive SQL a little tricky, not flaky, really, since it is good about returning data once you get all the components lined up. But it can drive you nuts trying to get everything right. It was far quicker programming for MSAccess, I have to say.
 
OMG I used Btrieve way back when it was a Novel product. Back then it was horribly complex to configure.

I would make sure with "SELECT * FROM TABLENAME", then try filtering it down. That way you can 'sneak up on it' so to speak.

Roo
Delphi Rules!
 
I'll try, but my big problem is to try and avoid loading a million record table. Hence all the ADOQuery's on the form. They work inside of a second.
I have a feeling filtering will be slow, but hey I came on here to get ideas and I'll give it a shot. I'm trying to set this up at home with trial versions of pervasive, otherwise I get to play with this only at the busy workplace.
 
If you're definitely going with Pervasive then you'll want to check out Peter has a TDataset descendant that hooks into the BTrieve layer (vs. the PSQL layer). You should be able to get awesome performance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top