Publish Information From a Database to a Web Page

How can I publish information from a database to a Web page?


Microsoft’s Active Server Pages (ASP) makes it a snap to publish information from a database onto a Web page. All you need is Microsoft Internet Information Server 4.0, a database (such as Microsoft Access or SQL Server), and a browser.

Here’s one of several ways that it can be done. First, create a data source name to your database through the Control Panel’s ODBC32 applet. Then create an Active Server Page using a text editor such as Notepad, or use the Visual InterDev integrated development environment. Use a standard HTML

and a standard HTML Submit button to create a form that can be submitted. Include the name of an ASP page as the value of the ACTION parameter and the word “POST” as the value of the METHOD parameter. You may include HTML controls, such as a textbox or a listbox for user input. When the user clicks the submit button, the ASP page named as the value of the ACTION parameter will execute. In that ASP page that executes, use ActiveX Data Objects (ADO) to open a connection to the database named in your data source name. Next, pass a SQL statement to the database to retrieve an ADO recordset. Iterate through the recordset using the MoveNext method of the ADO recordset object. Finally, write the values of the fields to the page using the Write method of the Response object.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: