ASP-db Validator Example - 1 Pro | Enterprise | Gold

How to setup an update such that the field is Required and not blank.

Procedures
  1. Setup Designer to edit the ACCESS or SQL Northwind database Employees table. Start fresh by clicking the "New" icon . Fill in the connection table and pick 3 fields as shown in the following -


  2. Click the Edit screen adn pick the same 3 fields for edit. Set the EmployeeID as bookmark and also the read only field.
  3. Click dbEdit to construct the primary edit properties. After this property is set, the Validation will be available for additional validating.


  4. Click the Default & Validation tab. At this point, it is important to make sure the Java CodeBase is correct. If you use the default setup, then the AspdbValidator.Jar file should be in the /ASPDB/Jar directory. Please note that this Unix based stuff is case sensitive and that includes the directory and file names.
  5. Click the LastName in the FieldsName List Box to indicate that you want to set the validating parameters of this field. 
  6. Pick the NOTBLANK Preprogrammed Mask. Check the "Required" Checkbox  and click the dbEdit button again to build the property line.
  7. Now,  you are ready. The Edit screen looks like -


  8. Now Click the preview button and click "Update". The LastName field is in Blue which means Valid.


  9. Now, delete the entry and make it blank an then perform an update. You'll see the following -


  10. Now, type some text in it an perform update again. It'll go.
  11. Put in some custom text in the "Field Error Text" box like "I got to have a Last Name". Click dbEdit button gain to re-generate the property. Repeat the update again and check the error in the error message box.
  12. You can see the ASP code generated by this exercise in the Code Window -

    <% Response.Buffer=True %>
    <!-- #include Virtual=/ASPDB/ASPdb.Inc -->
    <%
    Set X= Server.CreateObject("ASP.DB")
    X.dbUnit = "999"
    X.dbMode = "Grid"
    X.dbValidatorParams = "/ASPDB/Jars/"
    X.dbEditFlds = "(;,[]|~)EmployeeID,LastName[||||1~NOTBLANK~3~~~~1~I got to have a LastName],FirstName"
    X.dbEditParams = "(;,)TableName=Employees, BookMarkFlds=EmployeeID"
    X.dbEditUpdateROFlds = "EmployeeID"
    X.dbDebug = 101
    X.dbDSN = "DSN=NWIND"
    X.dbNavigationItem = "Top,Prev,Next,Bottom,GridRow,Reload,Edit,Update,Delete,Add"
    X.dbSQL = "SELECT EmployeeID,LastName,FirstName FROM Employees"
    X.dbUserLocalText = zUpdateHead & ",<Center><h3>Editing with ASP-db Validator</h3></Center>;"
    X.ASPdb
    %>