Open Dataset without request

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
FILLrate
Posts: 19
Joined: Thu 28 Jan 2010 09:14

Open Dataset without request

Post by FILLrate » Tue 30 Dec 2014 11:41

Hi!
Situation is the following.

I have a Master dataset:

Code: Select all

SELECT ID, Name FROM TCustomers WHERE ID=:ID
and detailed datasets:

Code: Select all

SELECT ID, Price, CustomerID FROM TOrders WHERE CustomerID =:ID

Code: Select all

SELECT ID, Value, CustomerID FROM TPayments WHERE CustomerID =:ID
...

Code: Select all

SELECT ID, Value, CustomerID FROM TOrderDetails WHERE CustomerID =:ID
1. Show GUI with appropriate controls and open Master dataset
2. Open all detailed Datasets.
2. User is viewing or editing all necessary info
3. Start transaction.
4. Post all Dataset if needed.
5. Commit transaction.

When I need to add new customers I simply change:
2. User is viewing or editing all necessary info -> 2. User INSERT all necessary info

It's OK, but I have to open all datasets and this make "empty" request to the DB server.

So the question is: How can I open dataset (set active=true) without executing DB request?

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Open Dataset without request

Post by azyk » Tue 30 Dec 2014 13:44

DataSet can't be opened without sending a SQL query to the server. Therefore, in your case, when inserting records, you can set the maximum allowed value for the ID field.

Post Reply