Solved

Offline dataset

Posted on 2000-05-10
11
558 Views
Last Modified: 2008-03-06
I use ADO components to connect to MS-SQL server using Delphi 5. I need to connect to server, retreive data and close the connection with the server and keep the table/stored procedure open.
I tried to use SaveToFile and LoadFromFile, but it still requere connection with the server.
I also create a temporary Paradox table to store this data, but it takes long time and quite complex.
I didn't want to change retreived data, only I want to read it.

Thanks for your pacience.

Motaz Abdel Azeem
0
Comment
Question by:Motaz
  • 6
  • 4
11 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2798928
hi motaz,

do you know, that the rx-library contains a memory table, where you can copy in your resultset ?

meikl
0
 
LVL 10

Expert Comment

by:ECollin
ID: 2799109
hi,

you can use the TClientDataSet as a memory table.

Emmanuel
0
 
LVL 7

Author Comment

by:Motaz
ID: 2799209
How can I copy the data from ADOStoredProc to TClientDataSet?

Motaz
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 10

Expert Comment

by:ECollin
ID: 2800583
Motaz,

in the IDE just right click on the TClientDataSet component and select "Assign Local Data" option.
Then, select your SP.

Emmanuel
0
 
LVL 10

Expert Comment

by:ECollin
ID: 2800701
Motaz,

at run-time you just have to set the provider property of your TClientDataset like this :

ClientDataSet1.Provider := myPS.Provider;
MyPS.Open;
ClientDataSet1.Open;

That's all

Emmanuel
0
 
LVL 7

Author Comment

by:Motaz
ID: 2806592
Emmanuel, it didn't work, there is no property called Provider in ClientData set. Is it ProviderName, and there is no Provider property in StoredProc1.

Motaz
0
 
LVL 10

Expert Comment

by:ECollin
ID: 2809721
Hi Motaz,

Which version of Delphi are you using ?
I'm using Delphi 3 C/S and it works fine.
The property "Provider" is not published.
Add "BdeProv" in the clause Uses of your unit.
Verify that you have the DBCLIENT.DLL in the WinNT\System32 directory.
If you want I can mail you some code.


Emmanuel
0
 
LVL 7

Author Comment

by:Motaz
ID: 2809940
I use Delphi 5 Enterprise, the Provider is not exists at all.
0
 
LVL 10

Expert Comment

by:ECollin
ID: 2810052
you're right. The property has been removed in Delphi 5!
Give me just the time to install D5 and to find your solution.

Emmanuel
0
 
LVL 10

Accepted Solution

by:
ECollin earned 80 total points
ID: 2810125
With Delphi 5, it seems you have to use a DataSetProvider (Midas) to link the dataset (Stored proc) to the clientDataSet.

Put a Datasetprovider on your form.
Set his DataSet property with your stored proc.

Set the ProviderName property of the clientdataset to the Datasetprovider.

Emmanuel
0
 
LVL 7

Author Comment

by:Motaz
ID: 2829988
Thanks it works
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question