Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 451
  • Last Modified:

Master/Detail with ADO and SQLServer 2000 ?

Hello all,

I'm just starting to develop a program with ADO and SQLServer 2000. I'm new with ADO and I need your advice. I run Delphi 6 professionnel on win2000 pro and MSQLServer 2000 on win2000 server.

My table structure is quite simple : I have 3 master table (policies, covers and clients).

1 policy can have 5 different clients (Assignee, recipient, club, owner, payer, etc)

1 policy can have unlimited covers and all covers can have 1 client (the insered).

My problem is when I put all these ADOtables in master/detail relationship, the application become very slow. With paradox, there is no problem, but I know that SQLServer does'nt like full table work. I know that I could use query with joins, but I have problem to display the information.

So, what choice do I have ?

BTW, I would like to buy some books on ADO and Delphi. Do you have any suggestion ??

Thanks in advance for your comment.
Oteau
0
oteau
Asked:
oteau
1 Solution
 
bogiboyCommented:
I had the same problem. My additional problem with Master_Details was unabillity to sort in grids (sorting set IndexFieldNames to the currently sorted-clicked-column).

Here is what I did after that, and it works OK;

For Master table write MyTableAfterScroll event like this:
Go to master table properties and in Events tab select OnAfterScroll event.

procedure TForm1.MyMasterAfterScroll(DataSet:TDataSet);
var
sMasterKey:string;
begin
sMasterKey:=MyTable.FieldByName('Record_id').AsString;
myChildTable.Filter:='MasterForeignKey='+sMasterKey;
myChildTable.Filtered:=True;
//filter other detail datasets if you want
end;

instead of using Table I use TADODataSet;
0
 
oteauAuthor Commented:
Thanks for your help.

I'm going to introduced a new method for my user. I know that it's not common that they will need all the policies, covers and insured. So, I'm using Stored procedure to retreive only the record they need to work on. It's simplify coding and it really improuved speed.

Thanks again.
Oteau
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now