Monday, October 12, 2009

Dreamweaver compose builds memoir of Blog whole journey (the design of 3)- database and join

Author: Dong Zhengke ability Cai Jiwen

The design of database of Doking's BLOG of the 3rd chapter and join

After compose builds good development environment, program of Doking's BLOG database is the 3rd pace, it also is the crucial step that matters to a database to whether can move effectively later directly, also be the normative demand that develops personnel to a database.

The standardization of 3.1 databases

The standardization of the database basically reflects structure of the relation between watch and watch, data and memory two big fields.

   3.1.1 data express the concern between

A lot of abecedarian often think, build a watch to store all data are OK. If so think, that classics regular meeting causes data redundant. Graph 3-1-1 is table of a data, can seeing the picture encircles medium data in red is redundant.

Graph 3-1-1 A data is expressed

What redundant data can affect a database is effective move, can push the database even destroy. To reduce redundant data, store data into a few watches apart, establish the join relationship between watch and watch. The join between watch and watch concerns, basically one is opposite much much, righter much, man-to-man 3 kinds of means.

Concern to how, it is type of relation of the prevailing in the database. This kind of relation double be called to be father watch and child the watch concerns or advocate watch and cent list impact. Graph 3-1-2 reflected a kind of father watch and child the watch concerns. Here, special subject watch and reply are expressed even if a pair of much impacts. Special subject watch is father watch, return table is child watch, the group in special subject watch can have 0 in return table travel, group or a lot of to it corresponding, and each in return table corresponding special subject in be being expressed with special subject is corresponding.

Graph 3-1-2  Concern to how

Concern to how more, every group that is the first piece of watch but a lot of travel that correspondence expresses the 2nd piece, no less, in the 2nd piece of watch every also can answer relatively with a lot of travel in the first watch. For example, a special subject can have a lot of users to reply, an user also can make special subject return for many times. This builds the 3rd piece of list with respect to need, special subject code and user code join, this is expressed even if the father of before two watches is expressed. In graph 3-1-3, "The reply is expressed " namely " special subject is expressed " with " the user is expressed " father watch.

Graph 3-1-3 Concern to how more

One-to-one relationship, the travel in expressing namely and the travel join in another watch come. This kind of relation is very scarce, because have so if, still be inferior to joining these two lists to be expressed for a piece more reasonable.

   3.1.2 data structure and store

The physical structure of the database must be based on logistic structure to build, need to remember a few regulation when designing form, field and concern. The order of travel and row does not have what effect, although be in data table, the row can have proper ordinal place, but they are not represented with this cite ordinal. The order of the record is in only they are taken out from inside data table and send the ability when using to act well. The extraction that SQL can pass parameter database index to handle a record is ordinal. For example, in data table, put sexual field before full name field, this wrong it doesn't matter, when wanting to using SQL statement to call this data to express only, it is OK to remember attune of full name field attune of full name field arriving before sexual field.

When design data is expressed, allocate field size to want discreet, below the case that uses quite, can save with respect to the province. If the field is used at storing integral, use integer or long integer please, need not odd precision or double precision, if be used quite, had better build the text type field of 100 character, and do not use remarks field. Why? The server charge that if you are not afraid of,holds high, do not be afraid that network database moves slow, you can need not pay attention to these, but it can bring about a database the badliest to break down.

3.2 Doking ' the design of S BLOG database

Be based on the knowledge of afore-mentioned database standardization, this begins to plan to design Doking ' S BLOG database. Doking ' 5 data table was designed in S BLOG database, it is LM watch respectively (the column is expressed) , ZT is expressed (study note is expressed) , HF is expressed (the reply is expressed) , YH is expressed (the user is expressed) , GLY is expressed (the administrator is expressed) , name the database for " Dkblog.mdb " , maintain presence " D:\Dat\ " below catalog.

LM is expressed namely column watch, use at website navigation the classify that build and learns note, column content is designed by the administrator of the website, if graph 3-2-1 place is shown,its field is designed

Graph 3-2-1 The field blueprint that LM expresses

ZT watch studies note list namely, it is to be used at storing the user publishs study result, if graph 3-2-2 place shows,actually the field designs:

Graph 3-2-2 The field blueprint that ZT expresses

HH watch replies namely watch, storing the reply that the user takes notes to the study that already published, its field shows like graph 3-2-3 place:

Graph 3-2-3 The field blueprint that HF expresses

YH is expressed namely user watch, storing the enrollment of the user information, convenient user logs onto the response that publishs study note and study note. If graph 3-2-4 place shows,its field designs:

Graph 3-2-4 The field blueprint that YH expresses

GLY is expressed namely administrator watch, use at the administrator to login, manage a website, its field designs 3-2-5 of the graph that be like a graph

Graph 3-2-5 The field blueprint that GLY expresses

 3.3 found Doking ' source of join of S BLOG database
 

(1) the Dreamweaver MX 2004 that start, be in [file] in menu, choice [build] , in [build a dialog box] in, choice category is " dynamic page " , choose dynamic page to be " ASP.NET VB " , by " found " pushbutton, found a dynamic webpage.

(2) switch arrives [applied process] face plate, choice [database] option gets stuck, click " + " date, choice " OLE DB joins " , if graph 3-3-1 place shows:

Graph 3-3-1 chooses OLE DB join

(3) playing piece [OLE DB joins] in the dialog box, input join name " Dkconn " , click " build " pushbutton, if graph 3-3-2 place shows:

Graph 3-3-2 Set join tag

(4) enter [data join attribute] page, choice [selection process] option gets stuck, because want the database that connective database is Access2003, choose in database engine so " Microsoft Jet 4.0 OLE DB Provider " as driver, if graph 3-3-3 place shows:

Graph 3-3-3 selects database engine

(5) choice [join] option gets stuck, the choice should join the database is " D:\Dkblog\dat\dkblog.mdb " , " user name " and " password " text casing Qing Dynasty is empty, be like graph 3-3-4

Graph 3-3-4 chooses join database

(6) choice [advanced] option gets stuck, in setting visit limits of authority, choose " ReadWrite " , if graph 3-3-5 place is shown

Graph 3-3-5 The setting visits attributive

(7) return [join] option gets stuck, click " test " pushbutton, if pursue,appear 3-3-6 dialog box, that specification has joined database Dkblog.mdb to the site. Click " affirmatory " the join of the pushbutton database that finish works. Below the root catalog of the site, can see added a new document " Web.config " , can be opposite directly in this file later the join of the database undertakes modification.

Graph 3-3-6 The database checks a dialog box

3.4 In join dialog box " build " the settlement with invalid pushbutton

If you are in 3.3 medium (3) click in measure [build] pushbutton, [data links attribute] the dialog box is not opened. Click [build] there are any reactions when pushbutton. A cause that causes this problem may be MDAC 2.8; The acquiesce in XP SP2 is including MDAC 2.8. If XP SP1 user installed MDAC 2.8, also can suffer the effect to this problem. This problem affects Dreamweaver MX 2004 only, and do not have an influence to Dreamweaver MX. Have two kinds of means of settlements:

The first kind of method: In receiving 3.3 medium measure (3) measure, in [OLE DB joins] in the dialog box [join string] the input in text area:

Provider=Microsoft.Jet.OLEDB.4.0;DataSource=D:\Dkblog\dat\dkblog.mdb;Persist Security Info=False

The 2nd kind of method: A new text document is founded on hard disk, change the patulous name of the file.udl by.txt, open.udl file next. This file can be opened [data links attribute] dialog box. Its provide gymnastics to make as follows:

① receives 3.3 medium measure in (3) measure. Carry out [begin] | [all programs] | [accessory] | [notebook] systematic menu command.

② is in notebook program advocate in the window, carry out directly carry out [file] | [save] menu command, playing piece [put additionally] the input file name in the dialog box is database join.udl, if pursue,3-4-1 place is shown.

Graph 3-4-1 Save " database join.udl "

③ is clicked [save] pushbutton, shut notebook sequence, switch arrives [desktop] in, doubleclick " the database joins " this file, according to the tutorial in (4) , (7) undertake operating. Click [affirmatory] pushbutton, shut [the database is linked] dialog box.

④ is carried out [begin] | [all programs] | [accessory] | [notebook] systematic menu command. In notebook program advocate in the window, carry out directly carry out [file] | [open] menu command, choice " the database joins " to open a file.

⑤ is in notebook program advocate in the window, choose all the 3rd character to undertake duplicating, if pursue,3-4-2 place is shown. Switch arrives in Dremweaver program, its stickup to (3) of measure playing piece [OLE DB joins] in the dialog box [join string] in text area, finish the database link in Dreamweaver so.

Graph 3-4-2 Duplicate " the database joins " all the 3rd in the file character

No comments:

Post a Comment