ASP 101 - Active Server Pages 101 - Web01
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates

ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

Script Output:
Text Field:
Integer Field:
Date/Time Field:

ASP HTML Download            FAQ

ASP+ Version

Well most of the aspects of this had already been covered in the other samples, but day after day the requests kept rolling in for a simple form to DB script! As such I finally just decided to write one but I would like to say that I'd appreciate it if you'd take a look at how these samples work and try to make some changes to get them to work the way you want. A lot of people are actually emailing me asking me to change the code or write code specifically for them! While I'd love to help I just don't have the time!

It's a pretty simple set of code, but I've added some things just to expose you to them. Specifically I do some error handling using the built in Err object and actually even raise my own error at one point. I also have used OLE DB instead of ODBC. I've switched to OLE DB for most of my DB work lately (it seems to be faster and more stable) so I figured I'd share that with our visitors.

Finally (and probably most importantly) I'm not using a recordset for this and have taken a few steps to make the DB work faster. I simply build a SQL command and do a connection execute. You'd think that would be enough, but even if your command returns no records this still returns a recordset! To stop it I specify adExecuteNoRecords to tell it that I know that no recordset will be returned and that one shouldn't be created! Heck that tip alone is worth the time you'll spend reading the code! And don't let the length scare you... most of it's just comments!

Oh and I almost forgot... this inserts into our sample DB which you can view from the Simple DB Sample. If you want an Access version you can download one here.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers