The most flexible and most flexible connection automatic connection of CS mode database

zhaozj2021-02-17  47

Problems faced by C / S mode database programs:

When the C / S development programmer is established, the connected database server is often fixed. (such as provider = sqloledb.1; password = 123; persist security info = true; user ID = sa; initial catalog = Empl; data Source = filesvr ") Here, FilesVR is the computer name where the SQL Server server is located. In the future, when publishing the software, the client's server computer name must be required to be FilesVR. This is a stiff low trouble solution. Senior programmer solves this issue. The way is to use Data Source = variables, but the variables here needs to write troubles in the installer or application, and many people are troublesome or pursue. Progress is not done, causing the trouble of software maintenance. And difficult. Copyright control features have their own solutions, which are very troublesome. Here is a simple and universal solution.

I developed CSManager.dll with the following features

Connection automatically creates function. It automatically determines whether the information required by the database connection is existing, automatically interacts with the user, saves and maintains this information, and provides information required for program database connection. Automatic judgment can establish a valid connection with the database and prompt a variety of possible failure. Since this, the DLL will automatically determine if there is a database server to use, no, it automatically pops up the dialog, let you choose, save it automatically. Each time it runs, it automatically detects if the database server can be connected. If the connection is not connected, the corresponding prompt information or dialog box is automatically popped. Regardless of whether the network is smooth, the server is started, whether the server is paralyzed, which can adapt to the process. In this way, even if the primary server is paralyzed, the client can also use the database server normally.

Automatic copyright control functions, you can use time limit, number of times, it does not lose copyright control role due to user changes in the system date or from new installation software. When it is over, it will automatically pop up the dialog box, the author will display the author's contact telephone email copyright information.

This DLL method property:

Automanage automatically manages the connection database server and determines whether the automatic copyright control function method LimitDays software uses the number of days LimitTimes software Use the number limit Contactemail When the software uses the date or number of times limited, the user can contact the developer. Contactphone, the user can contact Database Server Name Loginname Database User Name LoginPassword Database User Name LoginPassword Database User Name LoginPassword Database User Name LoginPassword Database User Password SHOWDIALOGOGFORM Dialog

Example: Examples of the following VB program

Public DatabaseComputername AS String (Database Server Name)

Public Loginname As String (User Name) of SQL Server)

Public Loginpassword As String (Landing Password) Private Sub Form_Load () Dim Aa As New Csmanager.Service Aa.automanage AA.LIMITDAYS = 100 Limit User Use 100 Day AA.LIMITTIMES = 5000 Limit users use 5000 times more than any condition software can not be used.

Aa.Contactemail = "wang517@21cn.com" (Over-term time users can contact the author) DatabaseComputername = aa.databaseComputename

Loginname = aa.loginname

Loginpassword = aa.loginpassword

(The above three variables can be established an effective database connection, don't need me again) SET AA = Nothingend Sub

转载请注明原文地址:https://www.9cbs.com/read-30384.html

New Post(0)