[ Pobierz całość w formacie PDF ]
.Changing Page Setup properties for datasheetsWhen exporting a form, table, or query, objects are formatted similarly to the waythey appear in the datasheet, including defined Format or Input Mask properties ifyou specify an HTML template.However, the column widths are automatically fittedto the display page properties of the datasheet (normally 8 inches wide).To changethese settings, display the datasheet of the form and use the Page Setup commandon the File menu before you export it.Exporting a datasheet to dynamic HTML formatYou can create dynamic HTML documents for datasheets that reside in MicrosoftIIS 1-2 (IDC/HTX format) or Microsoft Active Server Pages (ASP format).Thesepages are created at run-time when the user requests the information thus, theyare dynamic.When you export a datasheet to either of these formats, the generated HTML docu-ment queries the database for current data and sends that information back to therequesting browser.You can also save forms as ASP files that emulate most of the functionality of theoriginal form and display the data from your database on the Web server.The process of exporting a dynamic HTML format is essentially the same as export-ing a static format except that you choose the Microsoft IIS 1-2 or Microsoft ActiveServer Pages choice instead of the HTML Documents choice.NoteExporting to an Active Server or IIS 1-2 document is not the same as a data accesspage.These options create both an HTML document and an appropriate relatedfile for access by the corresponding server (an IIS or an ASP server).In general, to export a datasheet to dynamic HTML format, follow these steps:1.In the Database window, click the name of the table, query, or form that youwant to export, and then click Export on the File menu.3596-X ch35.F 5/30/01 11:50 AM Page 1199Chapter 35 &' Using and Creating Access Objects for Intranets and the Internet11992.In the Export dialog box, in the Save as type box, click Microsoft IIS 1-2 orMicrosoft Active Server Pages, depending on which dynamic HTML formatyou want to use.3.If you want to save to a different drive or directory, click the down arrow atthe right of the Save in combo box and select the drive or folder to export to.4.In the File name box, enter the file name.5.Click Export.6.Enter the appropriate information in the HTX/IDC Output Options orMicrosoft Active Server Pages Output Options dialog box, as shown inFigures 35-17 and 35-18.7.For either Output Options box, enter the location of the HTML Template (orlet it use the default value) in the HTML Template text box.8.In the Data Source Name text box, enter the name of the ODBC data sourcethat you connect to when the server-generated HTML files are processed onthe Web server.Figure 35-17: The HTX/IDC Output Optionsdialog box for exporting to a dynamic datasheetFigure 35-18: The Microsoft Active ServerPages Output Options dialog box for exportingto a dynamic datasheet3596-X ch35.F 5/30/01 11:50 AM Page 1200Part VI &' Access and the External World1200CautionCautionYou must specify the machine or file data source name that you use on theWorld Wide Web server and if required a username and password to open thedatabase.If you are exporting to ASP file format, you must enter the full destina-tion URL for the ASP file s directory (folder).For example, if you are storing the ASPfiles in the \SalesApp folder on the \\Pubweb server, type http://pubweb//salesapp/.After you finish, you are ready to publish your dynamic HTML document(s) to theWeb.Exporting a form to dynamic HTML formatYou can design an Access 2002 form for use in a World Wide Web application andthen save it to dynamic HTML format, as ASP files.Several types of forms can beoutputted view forms (to display records), switchboard forms (to act as thehome page or to navigate to related pages, such as all reports), and data-entryforms (to add, update, and delete records).Most of the controls on your forms aresaved as ActiveX controls that perform the same or similar functions as on theoriginal forms.CautionIf you have any Visual Basic code behind your forms or controls, none of it is savedor run when you create or activate the ASP file.In general, to export a form in dynamic HTML format, follow these steps:1.In the Database window, click the name of the form that you want to export,and then click Export on the File menu.2.In the Export dialog box, in the Save as type box, click Microsoft IIS 1-2 (*.htx;*.idc) or Microsoft ActiveX Server (*.asp), depending on which dynamicHTML format you want to use.3.Change the drive or folder to Export to (if you want to) by clicking the Save in:combo box.4.In the File name box, enter the file name.5.Click Save.You must specify the machine or file data source name that you use on the Webserver, and if required a username and password to open the database.If youare exporting to ASP file format, you must enter the full destination URL for theASP file s directory (folder).For example, if you are storing the ASP files in the\SalesApp folder on the \\Pubweb server, type http://pubweb//salesapp/.3596-X ch35.F 5/30/01 11:50 AM Page 1201Chapter 35 &' Using and Creating Access Objects for Intranets and the Internet1201Access 2002 outputs a continuous form as a single form.Access outputs most con-trols as ActiveX controls but ignores any Visual Basic code behind them.The out-put files simulate as closely as possible the appearance of the form by creating theappropriate HTML tags to retain attributes, such as color, font, and alignment.However, all data types are output unformatted, and all Format and InputMaskproperties are ignored.If a form is in Datasheet view or its Default View property is set to Datasheet whenyou export to ASP file format, then Access outputs the form as a datasheet.If theform is in Form or Design view, or its Default View property is set to Single Form orContinuous Forms, then Access outputs the form as a form.After you finish, you are ready to publish your dynamic HTML document(s) to theWeb.Processing an IDC/HTX file on the Web serverAfter you output a table, query, or form to an IDC/HTX file, Access creates twofiles an HTML extension file (*.htx) and an Internet Database Connector file(*.idc).The.idc file contains a query in the form of an SQL statement.For example,exporting the Pets, Owners & Visits query produced the.idc file, as shown inFigure 35-19.Figure 35-19: The SQL statement created for an.idc file that wasexported to Microsoft IIS 2 formatThe.htx file is an HTML file that contains the formatting information and placehold-ers for where to insert the values returned from the query in the.idc file.Figure35-20 shows the related.htx file for the Pets, Owners & Visits query.Figure 35-20 shows the left-most portion of the Preview view of the.htx file created.It is displayed in Microsoft s FrontPage.3596-X ch35
[ Pobierz całość w formacie PDF ]