WebDB User's Manual


Table of Contents


Installation

WebDB is distributed in a single .zip file. The first step is to extract this .zip file into the directory in the web server where you want the pages to appear. Once the directory structure is set up, you must tell the system how to connect to your database. It is assumed that you know how to connect to your database in ASP (otherwise, what good is a database interface?) Edit the file "functions.asp" and look for the line: conStr = "DSN=datasourcenamehere" This is line 21 in the current distribution. Edit this string to be the DSN of your database or some other connection string. Detailed information regarding connecting ASP to databases can be found on Microsoft's website: http://msdn.microsoft.com/.

Next, you will have to modify your database. WebDB requires four tables to be present in the database. These are: usertbl, querytbl, queryaccesstbl, and accesstbl. If these names conflict with tables already in your database, WebDB will have to be modified. (Send email to the author for help). A file containing the SQL code to create these tables is included in "setup.sql" Run the commands in this file against the database to set up the tables and create a temporary superuser account. This account will be used the first time you log in to the system, but should be changed immediately thereafter. The user name is "root" with password "openwebdb"


Usage

User Administration

Permission System

WebDB has a very granular permission system. Users are granted permission to tables and queries. Tables have three permission settings for each user: add-update, delete, and view. Thus, the superuser can set permissions such that a user can view a table, but not change it or delete records from it. Or he could set the permissions such that the user could add and edit records to the table, but not delete records. For other tables, it might be appropriate for users not even to be able to view the contents. (For example, the usertbl . No one should be able to view this table). These permissions are set in the table accesstbl. Simply add or edit records in this table to change user permissions. Note that the superuser transcends all permissions set. It is not possible to restrict the superuser, so be very careful when using this account or creating new superusers.

The Saved Query part of the database allows two permission settings per user: view and execute. Thus a user may be able to view, but not execute a query or execute but not view a query. These are set in the table queryaccesstbl.

 

Adding Users

At the moment, the only way to add users is to manually add records into usertbl. Having done this, you must also add entries in accesstbl and queryaccesstbl to allow the new user to access tables and run queries. A dialog box for adding users is planned for the next release.

 

Setting Table Permissions

At the moment, the only way to set table permissions for users is to manually add and edit records in accesstbl. NOTE: For boolean fields, you must enter either "_TRUE_" or "_FALSE_" for true and false values respectively. (That's in the FAQ). A dialog box for changing permissions is planned for sometime... :-)

 

Setting Query Permissions

At the moment, the only way to set query permissions for users is to manually add and edit records in queryaccesstbl. NOTE: For boolean fields, you must enter either "_TRUE_" or "_FALSE_" for true and false values respectively. (That's in the FAQ). A dialog box for changing permissions is planned for sometime... :-)

 

Queries and Executing SQL

New predefined queries may only be created by the superuser. Enter the SQL in the SQL text area and select one of the radio buttons indicating whether the query is a SELECT or another command (INSERT, UPDATE, etc). If it is something other than a SELECT, enter a table to be displayed upon completion of the command. This is equivalent of executing the command and then viewing the table specified. Execute the command to see that the results are as expected. When satisfied with the SQL, press the "Save Query" button. An input box will appear asking for a name for the query. Enter a name. The query will be saved and may be used later by selecting it from the list on the left. You will probably need to press the "Refresh" button under the Saved Queries to see the new query. NOTE: At this time, you must translate all single quotes to double single quotes and all double quotes to double double quotes for the system to accept your query.

 

About WebDB

WebDB was written by Eric Lorimer in the summer of 2000. WebDB may be found on the Web at: http://webdb.sourceforge.net/.

 

Future

There are certainly many improvements which can be made to the system. Some features and improvements are: (in no particular order)

This is where you fit in. If you are an ASP programmer I could certainly use your help. Many of the above improvements are fairly simple to implement. If you would like to help, visit the WebDB project page at http://sourceforge.net/projects/webdb/ and send me an email at ericl@users.sourceforge.net. And even if you're not a programmer, if you use WebDB or even think it has some potential, I would love to hear from you. Without user feedback (good or bad) development on this project will be slow or nonexistent.