Vous êtes sur la page 1sur 2

How To Connect an HTML Page to a Microsoft Access Database

Print Email Article translations


Article ID: 308459 - View products that this article applies to.

This article was previously pu lished u!der "308459 #$pa!d all % &ollapse all

'! This (a)e *+,,A-.

A data access pa)e is a! /T,0 pa)e that has a! '11ice 2e &o3po!e!t e3 edded i!to it. The '11ice 2e &o3po!e!t stores co!!ectio! i!1or3atio! a o descri es how to use data access pa)es to co!!ect a! /T,0 pa)e to ta les i! a data ase.

-e4uire3e!ts
(rior 5!owled)e re4uired: Data ase co!cepts

6a3iliarity with ,icroso1t Access co!cepts a!d user i!ter1ace

&reate the ,icroso1t Access Data ase


7. :.

:. 3. 4.

*tart ,icroso1t Access8 a!d the! create a !ew la!5 data ase !a3ed 9/T,0Access.3d 9. &reate a !ew ta le !a3ed 9&o!tacts9 y 1ollowi!) these steps: a. +!der Objects8 clic5 Tables. . Dou le-clic5 Create table by using wizard. The Table Wizard dialo) o$ appears8 a!d you are as5ed what types o1 1ields you wa c. I! the Sample Tables list8 clic5 Contacts. &lic5 the si!)le chevro! utto! ;>< 70 ti3es to copy the 1irst 70 ite3s 1ro3 the Sample new table list. &lic5 Next. d. Accept the de1aults o! the seco!d pa)e o1 the wi=ard8 a!d the! clic5 Next. e. *elect the Enter data into t e table using a !orm t e wizard creates !or me chec5 o$8 a!d the! clic5 Finis . Veri1y that a !ew ta le !a3ed 9&o!tacts9 has ee! created. Also veri1y that a !ew 1or3 !a3ed 9&o!tacts9 has ee! created. Type i!1or3atio! 1or two co!tacts i! the 1or3 ;you do !ot !eed to type &o!tact ID values<. +se the TA> 5ey to 3ove 1ro3 o!e 1ield to the &lic5 the Close utto! o! the Contacts 1or3. *ave the 1or3 as Contacts.

,ethod 7: &reate the Data Access (a)e y +si!) the 2i=ard

To create the data access pa)e y usi!) the wi=ard8 1ollow these steps: 7. *tart ,icroso1t Access. +!der Objects8 clic5 "ages. Dou le-clic5 Create data access page by using wizard. The "age Wizard dialo) o :. Veri1y that the 9&o!tacts9 ta le is selected i! the Tables#$ueries list o$. &lic5 the dou le chevro! utto! ;>>< to copy all the 1ields i!to t *elect Contact%&8 a!d the! clic5 the si!)le chevro! ;'< to ca!cel the selectio! o1 this 1ield. &lic5 Next. 3. The seco!d pa)e o1 the wi=ard allows you to or)a!i=e your data i!to )roups8 such as or)a!i=i!) co!tacts y cou!try. To 5eep the desi)! si3 as5s 1or the sort order o1 the records. &lic5 Next. 4. The 1i!al pa)e as5s 1or the title o1 the /T,0 pa)e a!d allows you to apply a the3e to the /T,0 pa)e. &lic5 Open t e "age8 a!d the! cli is !ow created a!d displayed. 5. +se the record !avi)atio! ar at the otto3 o1 the data access pa)e to 3ove throu)h the records a!d to create two 3ore co!tacts. ?. '! the File 3e!u8 clic5 Sa(e. *ave the data access pa)e as 9&o!tacts.ht39 i! the ,y Docu3e!ts 1older. @. -ead the 3essa)e that appears8 a!d the! clic5 O). &lose the data access pa)e.

,ethod :: &reate the Data Access (a)e y +si!) a! #$isti!) /T,0 (a)e
To create the data access pa)e y usi!) a! e$isti!) /T,0 pa)e8 1ollow these steps: 7. *tart Aotepad8 a!d the! type the 1ollowi!) /T,0:

2. <html> 3. <hea > !. <h">Accessing Data thro#gh HTML an Access<$h"> %. <$hea > &. <bo '> (. Loo)ing at E*cel +eb Com,onents to create a DAP -. <$bo '> .. <$hmtl>

70. *ave the 1ile as ,y/T,0.ht3 i! your ,y Docu3e!ts 1older. 77. I! 2i!dows #$plorer8 dou le-clic5 *y+T*,- tm. The /T,0 pa)e appears i! ,icroso1t I!ter!et #$plorer. "uit I!ter!et #$plorer. To create the data access pa)e li!58 1ollow these steps: 7. *tart ,icroso1t Access. +!der Objects8 clic5 "ages. Dou le-clic5 Edit Web page t at already exists. The ,ocate Web "age dialo) o$ &lic5 *y+T*,- tm i! the ,y Docu3e!ts 1older8 a!d the! clic5 Open. The /T,0 pa)e ope!s i! Desi)! view. :. &lic5 at the e!d o1 the li!e 90oo5i!) at #$cel 2e &o3po!e!ts to create a DA(98 a!d the! press #AT#- to create a !ew para)raph. 3. &reate a hyperli!5 to the &o!tacts /T,0 pa)e y 1ollowi!) these steps: a. '! the %nsert 3e!u8 clic5 +yperlin.. The %nsert +yperlin. dialo) o$ appears. . I! the Text to display te$t 1ield8 type Clic. ere to (iew Contacts +T*, "age. c. &lic5 the /T,0 1ile Contacts- tm i! the ,y Docu3e!ts 1older. d. &lic5 O) to retur! to the data access pa)e. :. &lic5 at the e!d o1 the !ewly i!serted te$t8 a!d the! press #AT#- to create a !ew li!e o! the data access pa)e. To edit a!d test the data access pa)e8 1ollow these steps: 7. 2ith the data access pa)e ope! i! Desi)! view8 select ite3s 1ro3 the Field ,ist. I1 you ca!!ot see the Field ,ist8 clic5Field ,ist o! the / e$pa!d the Contacts ta le. :. Dra) the FirstName a!d ,astName 1ields o!to the data access pa)e8 u!der the last li!e o1 te$t. Two pairs o1 la els a!d te$t o$es will e c !avi)atio! ar. 3. Dra) the Contacts ta le 1ro3 the Field ,ist o!to the data access pa)e8 a!d the! drop it a1ter the last te$t o$. The ,ayout Wizard dialo) Spreads eet8 a!d the! clic5 O). 4. The -elatio!ship 2i=ard appears. Accept the relatio!ship8 a!d the! clic5 O) to retur! to the data access pa)e. A! '11ice 2e *preadshee displayed. 5. '! the /iew 3e!u8 clic5 "age /iew to test the pa)e. ?. &lic5 New o! the record !avi)atio! ar to clear the First Name a!d ,ast Name te$t o$es. Type a !ew 1irst !a3e a!d last !a3e. &lic5 Sa The !ew data will e displayed i! the spreadsheet co!trol. @. *ave a!d close the data access pa)e. I! ,icroso1t Access8 clic5 Tables8 a!d the! dou le-clic5 the Contacts ta le. Veri1y that the !ew data a!d the! 4uit ,icroso1t Access.

Veri1icatio!
To ope! the data access pa)e8 1ollow these steps: 7. 'pe! I!ter!et #$plorer. I! the ,y Docu3e!ts 1older8 ope! the 1ile ,y/T,0.ht3. :. Test all parts o1 the pa)e. 3. &lic5 the hyperli!5 to veri1y that it li!5s to the &o!tacts.ht3 1ile.

NOTE: >e1ore you pu lish this data access pa)e to the 2e server8 veri1y that all paths are correct8 a!d cha!)e the hyperli!5s to +-0s. To cha!)e a co!!ectio!8 1ollow these steps: 7. *tart ,icroso1t Access. I! the data access pa)e Desi)! view8 ope! the ,y/T,0.ht3 1ile. :. I1 the Field ,ist is !ot visi le8 clic5 Field ,ist o! the /iew 3e!u. 3. I! the Field ,ist8 clic5 the "age co!!ectio! properties ico! that appears u!der the title ar o1 the 6ield 0ist pa!e. The &ata ,in. "ropertie 4. Veri1y that the co!!ectio! correspo!ds to the correct path to the data ase. 5. I1 you scale the data ase up to ,icroso1t *"0 *erver8 veri1y that the '0#D> (rovider is correct o! the "ro(ider ta . ?. &lic5 O) to co3plete the co!!ectio! property cha!)es. To cha!)e a +-08 1ollow these steps: 7. *elect the 1rie!dly te$t 1or the hyperli!5. :. '! the %nsert 3e!u8 clic5 +yperlin.. The Edit +yperlin. dialo) o$ appears. 3. Type a +-0 i! the 0ddress o$8 a!d the! clic5 O).

Vous aimerez peut-être aussi