Home > Software engineering >  Software users to use, a user to modify data, other users can see
Software users to use, a user to modify data, other users can see

Time:10-04

Made up a program to display and edit data in the datagrid, then saved to the database, but also want to achieve, the software used by a number of different computer users, after a user to modify and save, other users click on the "update" can see the modified document, the others don't know should how to do?
On this piece of is not very understanding, if time is enough, can you detailed answer, thank you

CodePudding user response:

You object


You said is from the base table or command execution records of the results of the complete, at any time, you object refers to a single record from the current records are set,





Description

Can use you object operation data from the provider, using ADO, through you object can be operated for almost all of the data, records (rows) and should be used in all you object field (column) to construct, due to the function different provider supports, some you method or property may be invalid,

ADOR. You and the ADODB library. You are used to create you object ProgID, the resulting behavior is the same as you object, has nothing to do with ProgID, ADOR. You with Microsoft? Internet Explorer installation and the ADODB library. You install with ADO, you object behavior by the environment (i.e. the client, server, Internet Explorer, etc.), the effects of these differences in the properties, methods and events in the "help" theme of,

In ADO defines four different types of cursors:

Dynamic cursor - used in view of other users to add, change and delete, and is used to not rely on bookmarks you in all types of mobile, if the provider support, you can use bookmarks,


Keyset cursor - like a dynamic cursor its behaviour, different only prohibit to see other users to add records, and prohibit access to other users delete records, data changes made by other users will still visible, it always supports bookmarks and therefore allows you in all types of mobile,


Static cursor - providing the record set of static copy to find data or generate a report, it always supports bookmarks and therefore allows you in all types of mobile and other users of add, change or delete will not be visible, it is open only when the client (ADOR) you object allows you to use the type of cursor,


Forward only cursors - except only allowed in the record of rolling forward, its behavior is similar to the static cursor, in this way, when you need to you in a one-way movement can improve performance,
In the opening set CursorType property before you to choose the cursor type, or use the Open method transfer CursorType parameter, part of the provider does not support all the cursor type, please check the provider's documentation, if you don't specify cursor type, ADO will Open the default forward only cursors,

If CursorLocation attribute is set to Open you adUseClient, then in return you object, Field object UnderlyingValue attribute is not available, for part of the Provider (such as Microsoft ODBC Provider for OLE DB together with Microsoft SQL Server), can be passed through the use of the Open method Connection string, according to the previously defined Connection object independently create you object, ADO to create the Connection object, but it is not to assign the object to the object variable, however, if you are on the same Connection Open multiple you object, it should be explicitly create and Open a Connection object, thus the Connection object is assigned to object variables, if the object is not used in the Open when you object variables, even in the case of the same Connection string, ADO for each new you will create a new Connection object,

You can create a required number of objects,

Open you, the current record is located in the first record (if any), and BOF and EOF attribute is set to False, if there is no record, default BOF or EOF is True,

Assumes that the provider support related functions, can use MoveFirst, MoveLast, MoveNext and MovePrevious method and Move, and AbsolutePosition AbsolutePage and Filter property to determine the location of the current record, only forward you object only support MoveNext method, when using the Move method to access each record (or enumeration you), whether can use BOF and EOF properties view mobile has more than you start or end,

Objects you can support two types of Update: Update immediately and batch updates, use Update now, once the Update method, the data of all changes will be immediately written to the basic data source, you can also use the AddNew method and Update the value of an array passed as a parameter, Update records of several fields at the same time,

If the provider support batch updates, can make the provider will more records changes in cache, and then use the UpdateBatch method will transfer them to the database in a single call, this situation is applied to use AddNew, Update and Delete methods for modifications, call UpdateBatch method, can use the Status attribute to check any data conflicts and solve them,

Note do not use the Command objects to execute a query, the query string should be passed to you the Open method of an object, but want to keep the Command text and repeat or using query parameters, still need to Command objects,

CodePudding user response:

Use SQL server as database, all clients connect it, data sharing,

CodePudding user response:

If you want to see real time change, how should do? ~

CodePudding user response:

reference xiaozhe_song reply: 3/f
if you want to see the real-time changes, how should do? ~


That will regularly continuous query, of course, you don't have to query directly to the target database table, because it can is bigger, can build a table, the other is only a field in a record: latest update time, the client queries it continuously, compared with your last update time record, once found the new update, to query the target database table, or even give you have updated,
  • Related