Online Database Editing ProgramBy Richard Chisholm
Here's a not so hypothetical situation. My web site is on a hosting company's server. I have a couple of databases up on it, but if I want to edit them normally I'd have to use FrontPage to access and download the whole thing. With a large database we're talking about a serious wait over a modem. Or how about this one: you need to have a person edit an online database, but they don't have access to the server. That's where this application comes in handy. After reading "Generic ASP Database Editor for Access Tables" by Roman Koch and using his app, I felt that by building a couple of layers on top of Roman's page, I could accomplish what I wanted. Namely an easy way to add/edit/delete records on any database in a web site without accessing it directly.
Now, before I get started let me say a few things:
1.) First, check out Roman's article (read more) and the ASPToday article
(read more) to get the basic info on his asp
scripts. For my app, the script that Roman wrote is left on a separate asp page, and includes his notes & comments. I have
made slight modifications to his script, and I have noted the areas where I this occurred in the script (and I
will also do the same here).
2.) This app is probably a resource hog. It uses Session variables and connects many times to the database, opening both recordsets and schemas. While this is certainly a useful tool for a few people, I really wouldn't recommend it for any significant number of users. (See Are Session Variables Really Evil? for more information!)
3.) Finally, because this uses the
id.innerHTML = DHTML property, only Internet Explorer 4.0 or greater
will work with this app.
This app is composed of the following files:
db-admin.htm(the frames page)
display.htm(the "display" page)
logic.asp(has all the asp script to process the requests)
dbedit.asp(Roman's asp script)
First off the frames page. I don't need to put the source here, just make it two rows named
logic set to 100% and 0% respectively. The
display.htm is your template web
Note the two spans. The one named
url is for inserting a "select another table" link, while
text is where all the generated HTML will be inserted.
Once the form is submitted, the
login.asp page runs. This page is discussed in detail in
Part 2 of this article.