Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles

SQL etc

Posted Sep 15, 2000

Simple SQL: Pt. 3 - Page 3

By Ted Brockwood

Creating and embedding your SQL statement(s)

Creating and embedding your SQL statement(s) into the asp page is very simple, and very visual, barring that you might have any complex functions you'd need to use. Right-click on the project name and select Add Data Command. Enter the name you wish to give the command (I've used "Basequery"), choose SQL Statement and SQL Builder. After a brief wait, the SQL builder window appears. You need to drag the data table you're going to use (mine is HOMEADV) into the central design pane. InterDev will display all the fields available to you in the table. From this, you may click on those you wish to include in your query. I've included MLNUM, STATUS, CITY, and LPRICEA. As you select your fields, the SQL window (two panes below the main) will display the SQL statement as it's being built. To customize the statement (I set the LPRICEA to less than 80000) you'll hand edit it in this viewer. When you're done designing the query, remember to save it. Then return to your asp page in the project viewer.

From the toolbar menu on the left, select Design-Time Controls, and Recordset. Drag the recordset control into the area marked by the "Add your content above" tag. The recordset control appears, which you'll need to modify to insert your query. If the Connection pulldown within the control doesn't show the name of the data connection you've added to the project, click on it and select the correct connection. The database object needs to be set to DE Commands and the Object Name must be set to that of your query. Save the file, and then choose View in Browser. You should now see a page displaying the data from your query. That's it! That's really all there is to creating database-connected Web pages with Visual InterDev.

If you don't see a nicely formatted data-connected page, there may be a problem with your configuration. Some things to check include:

  • Did you install Internet Information Server or Personal Web Server when installing InterDev?
  • Did you install FrontPage extensions and Active Server Pages support?
  • Do you have any security permissions set on the database? If so, you need to set those permissions when creating the data connection in InterDev.

As a closing note regarding InterDev, you should really run it under NT 4.0, as IIS and Active Server Pages can be problematic under Windows 95/98, even when you're just using it to develop sites and not deploy them. On another note, Active Server Pages are no longer Windows-specific - there have been ports for Unix and Linux developed, and a module for Apache has also been in place for some time now.

That's all there is for this series on SQL. Hopefully by now you have a basic understanding of SQL statements, structures, and its overall utility. With so many Web application development tools integrating SQL, I'm sure you'll find it quite useful when designing truly dynamic, database-driven Web sites.


Microsoft SQL Server and Visual InterDev 6.0
Pricing varies by licensing

PHP Scripting Language

Ted Brockwood is the Information Services Manager for a real estate listing service in Oregon. His experience covers Java, Linux, UNIX, NT, Win95/98, Win3.x, and DOS.

SQL etc Archives

Comment and Contribute


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



Latest Forum Threads
SQL etc Forum
Topic By Replies Updated
MySQL rollback UAL225 0 August 21st, 09:56 PM
Complex Search Query Galway 0 May 20th, 10:04 PM
change collation at once supercain 2 May 15th, 06:18 AM
SQL Features, tools and utilities question Neomite 1 April 10th, 09:13 AM