Commonly Used SQL Code With FrontPage

Here are some snippets of the most common SQL statements used with the database wizard.

Use these code snippets in the database wizard to extend the wizards functionality
Note: these examples are using the Northwind database. You must create a method to first display the record you want to edit or delete and then pass a parameter (such as the ID field) to the page containing the code below. Click HERE to see examples on how to pass a parameter.

Delete Statement Example:

DELETE FROM Employees WHERE EmployeeID = ::EmployeeID::

Insert Statement Example: This example adds a record to a database table from a form with two text input boxes. You create the form on one page, name the form fields to match the database fields and then submit the form to the page containing this code. See a more detailed example HERE.

INSERT INTO Employees (FirstName, LastName) VALUES (‘::FirstName::’, ‘::LastName::’)

Update Statement Example: You’ll want to start this from a page showing a record in text boxes, edit the record and submit to the page containing this code:

UPDATE Employees SET Phone=’::Phone::’, Email=’::Email::’ WHERE EmployeeID = ::EmployeeID::

Leave a Reply

Your email address will not be published. Required fields are marked *