Quickly build a database framework for ERP
The ERP software, the database is its soul. Each one has its own ERP software, database, and these databases are the most critical database framework. So what is a database framework? What is the role of his? Why should it be installed to build a database framework?
In the preparation of ERP, MIS, S / B and other database applications, the first thing to do is to establish a database framework, which includes at least: database and database tables, of course, views, stored procedures and so on, which is database framework (excluding the specific data). Then using vb, vc, vfp, pb programming languages such as development of user interfaces, accept a user operation of the database. When you successfully developed ERP software, you need to package it and finally handed over to customers to install and use. At this time there is a problem, when you pack when the sql server can not be packaged into the installer, so users must first use the framework to establish a database, and users do not know the database framework, ERP software, must also access to a particular database framework can run successfully, then we need to have an automatically generated database framework program. For example: When developing a human resources management system, the need for a database framework, which at least in the database contains a table, the table contains the name, age, salary and other information, and then the client to access the table. Without this table, the program can not successfully run. Now everyone is clear what his role is a database framework and a bar!
ERP software are now automatically generated database framework with the functions of different software implementation methods, to sum up, about three kinds:
1. In the form of the wizard;
2. In the installation to configure the system in the form;
3. Integrated into the main program, when running the main program for the first time when the automatic generation of database framework.
Whether that way, and their uses are the same.
If you have any "housekeeper" of the ERP, you can install to see. It requires prior installation of sql server, open the sql server after you install sql server database, you will find only a few database, it is the default, no different. Then proceeded to install "housekeeper," with what he casually after you install the feature, and then open the sql server you will find that the database is different, and added some database (the database to increase the use of the function and the "housekeeper," different versions but different). These additional databases are to use the database framework automatically generated.
So, how to use programs to achieve automatic generation of database framework? Now, let's create such a program. In this process the Indian Communists to establish five buttons are: the establishment of a database establish schedules, constraints, building stored procedures, display the data. The code to achieve the following:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim con As New OleDb.OleDbConnection ( "Provider = SQLOLEDB.1; Integrated
Security = SSPI; Persist Security Info = False; Initial Catalog = Northwind; Data
Source =.; Use Procedure for Prepare = 1; Auto Translate = True; Packet
Size = 4096; Workstation ID = J; Use Encryption for Data = False; Tag with column collation
when possible = False ")
con.Open ()
Dim cmd As New OleDb.OleDbCommand ( "create database jk", con)
cmd.ExecuteNonQuery ()
con.Close ()
'The establishment of a database
End Sub
Private Sub Button2_Click (ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim con2 As New OleDb.OleDbConnection ( "Provider = SQLOLEDB.1; Integrated
Security = SSPI; Persist Security Info = False; Initial Catalog = jk; Data Source =.; Use
Procedure for Prepare = 1; Auto Translate = True; Packet Size = 4096; Workstation ID = J; Use
Encryption for Data = False; Tag with column collation when possible = False ")
con2.Open ()
Dim cmd As New OleDb.OleDbCommand ( "create table kk (id int identity (1,1) not
null constraint id primary key, name char (4) not null) ", con2)
cmd.ExecuteNonQuery ()
Dim cmd2 As New OleDb.OleDbCommand ( "create table pp (id int not null, ads
char (20) null) ", con2)
cmd2.ExecuteNonQuery ()
con2.Close ()
|