Article View: borland.public.cppbuilder.database.ado
Article #4036Re: Master Detail datasets and server-side cursors
From: Vassiliev V.V.
Date: Tue, 23 Apr 2002 06:31
Date: Tue, 23 Apr 2002 06:31
123 lines
5707 bytes
5707 bytes
Ado help file - Ado2XX.chm. It may by in C:\Program Files\Common Files\System\Ado or you can install it with MDAC SDK (it is included with MS SQL Server or you can download it from http://www.microsoft.com/data). Look there ADO programmer's guide/Chapter9. Data Shaping. Here are some citations from this file: Data shaping typically requires two providers. The service provider, Data Shaping Service for OLE DB, supplies the data shaping functionality, and a data provider, such as the OLE DB Provider for SQL Server, supplies rows of data to populate the shaped Recordset. The name of the service provider (MSDataShape) can be specified as the value of the Connection object Provider property or the connection string keyword "Provider=MSDataShape;". The name of the data provider can be specified as the value of the Data Provider dynamic property, which is added to the Connection object Properties collection by the Data Shaping Service for OLE DB, or the connection string keyword "Data Provider=provider". The shape provider always returns a client cursor, even when the user specifies a cursor location of adUseServer. Regards, Vassiliev V.V. http://www.oledbdirect.com "Tony" <hse@hill-soft.com> �������/�������� � �������� ���������: news:3cc46f57$1_1@dnews... > Thanks for your repley. The provider I am using is SQLOLEDB. I still have > questions about this because other people do not seem to have any problems > with master-detail relationships. Look at Brian Bushay's answer to the same > quesion under delphi.ado group. He says he can't even duplicate the problem. > Also I don't have any problems with the master detail relationship other > than getting the correct master autoinc field to populate a new detail > record FK field. All other operations (selects, updates) seem to work OK. Do > you know of any documentation on this? > > > "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> wrote in message > news:3cc3d216_2@dnews... > > Master-details relationship in ADO is supported by MS Shape provider. It > > works with other providers and requires client-side cursor. Most (if not > > all) other providers do not support master-detail. Sorting and filtering > is > > not supported by most providers too. So, the only one way to use > > master-detail is to do it manually - open a master dataset and, every time > > you move requery your detail dataset. > > > > Regards, > > Vassiliev V.V. > > http://www.oledbdirect.com > > > > "Tony" <hse@hill-soft.com> �������/�������� � �������� ���������: > > news:3cc2f644_2@dnews... > > > Borland Builder 5 > > > MS-SQL > > > ADO Express > > > > > > Can anyone tell me how to use a server cursor location in a master > detail > > > table relationship? > > > > > > I have an application with a master table I will call Master and a > detail > > > table I will call Detail. The Detail table DataSource property is set to > > > Master. Detail.MasterID= Master.ID. The application works fine as long > as > > I > > > use client-side cursors. I need to change the detail table to server > side > > > cursors because it will contain many (500,000 +) records and I do not > want > > > to load these records into memory. > > > > > > I changed the Detail dataset cursor location to server and cursor type > to > > > keyset. This caused the error "Current provider does not support > necessary > > > interface for sorting or filtering" when the table is opened because the > > > IndexFieldNames property of the dataset cannot be used with a server > > cursor > > > location and this property is used in a detail table dataset to > reference > > > the master table. In this case Master.ID > > > > > > I tried changing the detail dataset to a query from a table as follows. > > > Select * From Detail Where MasterID = :ID. The Detail table datasource > > > remains set to the Master table. This allowed the Detail table open > > without > > > errors but when adding a Detail record in a form using TDBNavigator the > > > Detail.MasterID is no longer set to the Master.ID and remains NULL. This > > > relationship (Detail.MasterID = Master.ID) was maintained automatically > > when > > > the cursor location was set to Client. > > > > > > I tried setting the Detail.MasterID field manually in the BeforePost > event > > > but got the error "Multiple step OLE DB operation generated errors ...". > > > > > > Thanks in advance for any advice on how to solve this problem. > > > > > > > > > > > >
Technical Details
Message-ID:
<3cc5069a_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!195.40.4.120.MISMATCH!easynet-quince!easynet.net!proxad.net!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3cc2f644_2@dnews> <3cc3d216_2@dnews> <3cc46f57$1_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,c4baa2abb07efafd X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-04-23 00:09:02 PST From: "Vassiliev V.V." <news@vassilievvv.mtu-net.ru> Newsgroups: borland.public.cppbuilder.database.ado References: <3cc2f644_2@dnews> <3cc3d216_2@dnews> <3cc46f57$1_1@dnews> Subject: Re: Master Detail datasets and server-side cursors Date: Tue, 23 Apr 2002 10:31:49 +0400 Lines: 127 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 62.118.128.49 Message-ID: <3cc5069a_2@dnews> X-Trace: dnews 1019545242 62.118.128.49 (23 Apr 2002 00:00:42 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!195.40.4.120.MISMATCH!easynet-quince!easynet.net!proxad.net!fr.usenet-edu.net!usenet-edu.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews