Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Web Development
Expertise: Beginner
Aug 24, 1999

Publish Information From a Database to a Web Page

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

Answer:

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.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date