Offline dataset

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
LVL 7
MotazAsked:
Who is Participating?
 
ECollinConnect With a Mentor Commented:
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
 
kretzschmarCommented:
hi motaz,

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

meikl
0
 
ECollinCommented:
hi,

you can use the TClientDataSet as a memory table.

Emmanuel
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
MotazAuthor Commented:
How can I copy the data from ADOStoredProc to TClientDataSet?

Motaz
0
 
ECollinCommented:
Motaz,

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

Emmanuel
0
 
ECollinCommented:
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
 
MotazAuthor Commented:
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
 
ECollinCommented:
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
 
MotazAuthor Commented:
I use Delphi 5 Enterprise, the Provider is not exists at all.
0
 
ECollinCommented:
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
 
MotazAuthor Commented:
Thanks it works
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.