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

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
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.

Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

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