Link to home
Start Free TrialLog in
Avatar of Motaz
Motaz

asked on

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
Avatar of kretzschmar
kretzschmar
Flag of Germany image

hi motaz,

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

meikl
Avatar of ECollin
ECollin

hi,

you can use the TClientDataSet as a memory table.

Emmanuel
Avatar of Motaz

ASKER

How can I copy the data from ADOStoredProc to TClientDataSet?

Motaz
Motaz,

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

Emmanuel
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
Avatar of Motaz

ASKER

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
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
Avatar of Motaz

ASKER

I use Delphi 5 Enterprise, the Provider is not exists at all.
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
ASKER CERTIFIED SOLUTION
Avatar of ECollin
ECollin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Motaz

ASKER

Thanks it works