Microsoft KB Archive/154534

= DBWEB: How to Create Custom Success/Failure Messages =

Article ID: 154534

Article Last Modified on 9/26/2003

-

APPLIES TO


 * Microsoft dbWeb 1.0
 * Microsoft dbWeb 1.1

-



This article was previously published under Q154534



SUMMARY
Microsoft DbWeb can insert, update, or delete records from various back-end databases. Typically, you want to supply the user with some information about whether their insert, update, or delete was successful. DbWeb supplies a default insert, update, and delete success/failure message. This is generally enough information; however, you may want to customize this message.

Your custom insert, update, and delete message can be an entire HTML document that can take on the look and feel of the rest of your HTML documents. You can customize these messages in two ways.

First, you can type the HTML directly in the property sheet of the "Insert success msg," "Insert fail msg," "Update success msg," "Update fail msg," "Delete success msg," and "Delete fail msg."

Second, you can supply a URL to an HTML document; however, you must use the  HTML tag. However, this HTML tag is not supported by all browsers. Some browsers that do support it are Microsoft Internet Explorer versions 3.0 and 2.0, and Netscape versions 3.0 and 2.0.



MORE INFORMATION
The following steps detail the two methods described above.

Method 1 - Typing HTML Tags into Property Sheet
 Start dbWeb Administrator. Select and open the Customers sample schema. In the Schema tab, click to select the Insert check box. Click the Ins/Upd/Del tab. Under "Data columns in selected table," expand the Customers table by double-clicking it. Click the Add-All button.</li> Under "Insert data columns," select "Customers.Customer ID."</li> Click the Properties button.</li> On the properties sheet, make sure that you are looking at the Insert/Update Form properties. To do this, just below the titlebar of the properties sheet, there is a drop-down list. Click the arrow to view your three selections, and choose the Insert/Update Form Properties.</li> Type the following in the "Insert success msg" property:

Your insert was successful

</li> Type the following into the "Insert fail msg" property:

Your insert failed

NOTE: The "Insert success msg," "Insert fail msg," "Update success msg," "Update fail msg," "Delete success msg," and "Delete fail msg" properties are limited to 2047 characters. Also, you can use plain text without the HTML tags. The HTML tags will allow you to customize the look in your Internet browser.</li> Close the properties sheet.</li> Click the Apply button.</li></ol>

Method 2 - Using a URL to Reference a Custom HTML Document
NOTE: The following example references two HTML documents called MySuccess.htm (insert success message) and MyFail.htm (insert failure message). Just substitute your own custom HTML document names for MySuccess.htm and MyFail.htm.

<ol> Start dbWeb Administrator.</li> Select and open the Customers sample schema.</li> On the Schema tab, click to select the Insert check box.</li> Click the Ins/Upd/Del tab.</li> Under "Data columns in selected table," expand the Customers table by double-clicking it.</li> Click the Add-All button.</li> Under "Insert data columns," select "Customers.Customer ID."</li> Click the Properties button.</li> On the properties sheet make sure that you a looking at the Insert/Update Form Properties. To do this, just below the titlebar of the properties sheet, there is a drop-down list. Click the arrow to view your three selections, and choose the Insert/Update Form Properties.</li> <li> Type the following into the "Insert success msg" property: <META HTTP-EQUIV="REFRESH" CONTENT="0; URL=/dbWeb/MySuccess.htm"> </li> <li> Type the following into the "Insert fail msg" property: <META HTTP-EQUIV="REFRESH" CONTENT="0; URL=/dbWeb/MyFail.htm"> NOTE: The above "URL=/dbWeb/MySuccess.htm" assumes that your relative path to the dbWeb documents folder is "/dbweb/" and your HTML document is located in that folder. </li> <li>Close the Properties sheet.</li> <li>Click the Apply button.</li></ol>

To test these two methods, open your favorite browser and use the "getqbe" method to open the Customers sample schema. Click the Submit Query button. On the next page, click the Submit button. Type a new CompanyID and Company Name, and then click Submit Insert. You should see your custom success message. To see your custom failure message follow the same steps, except do not type any information on the submit customer page, and then click Submit Insert. You should now see your custom failure message.

<div class="references_section">