Problem regarding Database
"Munjal Gajjar" <[email protected]> Thu, 7 Aug 2003 13:41:16 +0530
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Organization | Sahajanand Technologies (P) Ltd |
| Message-ID | <000a01c35cbb$79e38720$48c8a8c0@munjal> |
Hi,
I have been working in Delphi Graphics for last few years. This is my
first database project.
I am developing a multi user database application. For that, I am using
ADO.
Now, same application is running on two different machines at the same
time.
When, first application is executing this procedure, it locks the
connections. And the other application cant execute this procedure at
that time.
In short, what I want to do is, two different machines can save data at
the same time. For that, Please suggest me, what should I do.
Here is a sample code
function TDataDiaDetect.GetNewID() : integer;
var
E : Exception;
t : TDataSetState;
begin
try
tblTempID.LockType :== ltOptimistic;
tblTempID.Open();
CONDiaData.BeginTrans();
tblTempID.SafeCallException()
tblTempID.Edit();
tblTempID.FieldByName('lastID').Value :=tblTempID.FieldByName('lastID').AsInteger + 1;
result :== tblTempID.FieldByName('lastID').Value;
t :== tblTempID.State;
tblTempID.Post();
t :== tblTempID.State;
CONDiaData.CommitTrans;
tblTempID.Close();
except
CONDiaData.RollbackTrans;
ShowMessage('Error in GetNewID ' + E.Message);
end;
Any help will be appreciated,
Munjal Gajjar
---
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->
CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
---------------------------------------------------------------
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/