At the same time to add data of the same SQL SERVER database, delete operations such as,
CodePudding user response:
DataSnap three layer, through the IP address and port number, the registration of the same computer to connect to a remote service, is not the difference between IP address, therefore, a computer use only one client,CodePudding user response:
Can, of course, from the perspective of the SQL Server Server is a computer run N the client, and N computer running a client is no different,If your problem is multiple clients to a SQL database to modify the same data will cause conflict, this is no problem, because the SQL transaction (Transacton) management mechanism,
CodePudding user response:
Mainly depends on the connection way,CodePudding user response:
1, B/S mode, through the browser to access, access, for the same computer two browser cookies are often used, to distinguish,2, C/S mode, through the client access, for the same computer two client access, access is the same person, is no difference between using,
3, under normal circumstances, two client access, as a client's visit, at this point, the same computer to run two of the same SQL SERVER data client, can operate the same SQL database for operation respectively, but the meaning is not big,
4, if you want to get the same computer two client access, as different customers, the process data in the server, each statement has to join the customer identification number, so that by the SQL statement, to join the identification code,
CodePudding user response:
Delphi, remobject good!CodePudding user response:
Can, with two computers running a differenceCodePudding user response:
Ok, note lock operation data,CodePudding user response:
Upstairs friend very detailed answer, yes, the key lies in the identification of the difference,CodePudding user response:
Identification number is what things?CodePudding user response:
Why can not, SQL is incredibly strong to you,CodePudding user response:
Answer: yes,This is a multi-user, concurrency, the concept of sharing,
You are ready to handle resource concurrent and data sharing ideas,
Such as delete,
A client to delete the data, another client didn't update in time, also want to delete the same data, can produce unexpected errors,
Such as: query,
A client adds new data, but there is no update, another client will prompt can not find the data,
And: update,
A client to update the data, another customer also to update the same data, then a client to see the data before, it is not the latest,
.
Conclusion: you the data after the completion of the operation, if necessary, you have to tell other client updates or other operations,
Suggestions: 1. Try to use structured SQL statement data operation (such as: use the Query, Execut to complete data insert), try to avoid using Query. Edit; ,,, Query. Post; Statements, such as
2. As far as possible with a transaction, it is the Connection. BeginTran; . Connection.Com mitTran;
CodePudding user response:
Completely no problem!CodePudding user response:
This problem, inductive one word: ok,CodePudding user response:
Can, but submit a first-in, first things processing, lock handle, MSSQL actually say two thousands will doCodePudding user response:
Absolutely, I developed the client is the same computer at the same time, can open multiple, only need to submit is no problem with the transaction when saveThe following are examples of D7 + ADO
Try
If PubData1. Con1. InTransaction then//ADOConnection remove the current transaction
PubData1. Con1. RollbackTrans;
PubData1. Con1. BeginTrans;//ADOConnection begin transaction
//write your save statement
//now has not yet been submitted to the real database
PubData1.Con1.Com mitTrans;//it is said to submit
MessageDlg (' saved successfully! ', mtInformation, [mbOK], 0);
Except,
On E: the Exception do
The begin
PubData1. Con1. RollbackTrans;//if the submitted data error will be rolled back, this is very important
MessageDlg (' data save failed! The reason is: "+ # 13 # 10 + E.M essage, mtWarning, [mbOK], 0).//the contents of the report error
end;
end;
CodePudding user response:
What is two of the same SQL server data to the client?1, a SQL server2014, a SQL server2017, running at the same time, set the same path, use the same database, you can, that's what I do,
2, two 2014 or 2017, as long as you can run, my 32-bit Windows 7 + 2014 no problem,
3, a VB.net, a Delphi, two application to a database, no problem, I am a database for the three different applications, there is a PB,
4, are both Delphi, corresponds to a database, 3 is no problem, the more questions,
CodePudding user response:
In theory, should be able toCodePudding user response:
Delphi ADOConnection1 connection, don't worry about this problem, I now have three main interface ADOConnection connect three databases, and the client is more, can be said to be the N on the relationship between the N, completely no problem.CodePudding user response: