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
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
hi,
you can use the TClientDataSet as a memory table.
Emmanuel
you can use the TClientDataSet as a memory table.
Emmanuel
ASKER
How can I copy the data from ADOStoredProc to TClientDataSet?
Motaz
Motaz
Motaz,
in the IDE just right click on the TClientDataSet component and select "Assign Local Data" option.
Then, select your SP.
Emmanuel
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
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
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
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
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
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
Give me just the time to install D5 and to find your solution.
Emmanuel
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks it works
do you know, that the rx-library contains a memory table, where you can copy in your resultset ?
meikl