Important alert: (current site time 7/15/2013 11:58:21 PM EDT)
 

winzip icon

Basic of Database with ASP

Email
Submitted on: 9/5/2000 1:20:29 PM
By: Arsalan Suzuki  
Level: Beginner
User Rating: By 32 Users
Compatibility: ASP (Active Server Pages), HTML
Views: 68491
(About the author)
 
     This piece of code demonstrate the way of accessing database (basic reading and writing). Good for beginners who wish to learn ASP. Nearly every line is documented.
 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

9/7/2000 1:25:43 PMPaul B

Wow, this is what I need!!! Great code for begenners and a great comment/line ratio!!! Keep up the good work!!!
(If this comment was disrespectful, please report it.)

 
9/12/2000 12:51:24 AMEsmeralda

I think this is a great code.
I can view the inputed data fine.
Except when i want to open the data
base, since i am using access 97, how
do i update this so i can view the imputed data through access. any help
will be appreciated.

thanks.
(If this comment was disrespectful, please report it.)

 
9/12/2000 4:00:22 AMArsalan

Only help I can give is that , create the same database in Access 97
(If this comment was disrespectful, please report it.)

 
9/12/2000 6:23:39 PMEsmeralda

dear arsalan,
how do i add more fields
such as address, city, state, phone..ect.

????
(If this comment was disrespectful, please report it.)

 
10/23/2000 2:33:21 PMChris

Thank you very much... This really help me understant how ASP works. All the tutorialls on the net are so advanced that i could never understand them..This is a perfect tutorial for beginners.. Thanks a lot Arsalan
(If this comment was disrespectful, please report it.)

 
11/18/2000 1:57:29 AMBeuno

I just want to say how much we apretiate the submitions ppl make, cause I think thats not said enough
(If this comment was disrespectful, please report it.)

 
2/21/2001 12:08:15 AMMark V

I want to thank you for this code. It is well documented and helps newbies out when trying to use ASP and apply it.
(If this comment was disrespectful, please report it.)

 
4/8/2001 6:38:57 AMExus

Great code been looking for a simple code like this for ages thanks for makeing this available and a top notch! Explanation on wot everything does :)
icq 6051839

(If this comment was disrespectful, please report it.)

 
4/24/2001 8:10:06 AMStewart MacFarlane

This code is excellent for my needs. But im getting errors using the raw code you supplied without any modifications:

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/aspvb/add.asp, line 29


Browser Type:
Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Page:
POST 30 bytes to /aspvb/add.asp

POST Data:
txtnameadd=hello&ButtonAdd=Add

and the delte doesnt delete entried in the database

Ive checked to make sure the database file is not set to read only and that nothing in the database is locked. can you help?

(If this comment was disrespectful, please report it.)

 
4/24/2001 12:10:12 PMCode Master

Stewart MacFarlane :
Its because the folder in which you've kept the database file doesnt have read/write permission, that is why its giving the error
(If this comment was disrespectful, please report it.)

 
4/27/2001 3:40:15 PMRene

Thank you so much for posting this! In dealing with many database connection errors, i put this on my server and with a few changes to match my locations of files, it worked! You and your clean, easy code saved the day. I thank you!!!!
(If this comment was disrespectful, please report it.)

 
7/5/2001 11:01:21 PMChris Woods

Thanks for sharing your great ideas and ASP inventions with the masses. I'm sure that my limited knowledge of ASP will improve after studying your code.

Also, do you know of any downloads on this site that can be used to create something like a a review site for autos, with a reviews page and payment page for advertising and stuff?


Thanks,
Chris Woods
chriswoods@ntlworld.com
(If this comment was disrespectful, please report it.)

 
10/1/2002 9:07:47 PM

The code doesn't work on my website. What possible reasons might there be? I keep getting 500 errors every time I try to run the command.
(If this comment was disrespectful, please report it.)

 
10/2/2002 3:30:37 AMCode Master

See above for the solutions to your problem.
(If this comment was disrespectful, please report it.)

 
2/20/2003 12:26:39 AM

hi there,
i also got problem same as macfarlane.
what do you mean by because of the database file doesn't have read/write permission, the page got the error. how do we know it is on permission or not. i check my folder (in which the database reside), and it is not read-only. hope u can help me.
(If this comment was disrespectful, please report it.)

 
2/20/2003 2:42:37 AMCode Master

Read/Write permission of the folder have to be set from the server software (Personal Web Server or IIS).
(If this comment was disrespectful, please report it.)

 
9/9/2003 12:10:27 AMWayne & Carr Barron

Man this code rocks :-) !!

I have been searching the internet for a "Linking System" I have been needed to have a "Database Driven Links Page" on this site that I am developing. And never could find one that was good easy to understand, But looking through your code, I was able to learn in "5-minutes" how to connect onto "2" Tables and make the information work together. Thus creating a Web link,
With "Link Name - From Table Name" & "Link URL - From Table URL" Man this is sweet, thank you so very much for taking the special time to write this code tutorial for us, This is surpurb, Please keep up the great work.

Wayne & Carr Barron
Carrz-Fox-Fire Promotions
(If this comment was disrespectful, please report it.)

 
9/9/2003 12:18:56 AMWayne & Carr Barron

p.s.
Just voted for you to bring you up to [28-votes].......

And I just have to say this much now.
This code is so very well documented and easy to follow and has been viewed [45490 - times] I do no see why only [28 - people] have voted for this code.

Great Work [Code Master]

Wayne & Carr Barron
Carrz-Fox-Fire Promotions
(If this comment was disrespectful, please report it.)

 
9/9/2003 12:18:36 PMCode Master

Wayne & Carr Barron
Thanks

(If this comment was disrespectful, please report it.)

 
2/25/2004 4:54:08 PM

hey thanks for the code its great!
but i have one problem... for some reason it doesnt allow me to add more fields accept for the name field...

thanks for your time...
- ben (benovak@walla.co.il)
(If this comment was disrespectful, please report it.)

 
3/10/2004 1:15:31 AM

nice code. tnx a lot! ü
(If this comment was disrespectful, please report it.)

 
4/12/2004 2:01:50 AM

It's really nice code! thanks!
(If this comment was disrespectful, please report it.)

 
4/14/2004 11:05:07 AM

Other errors? I am getting the same error about the DB not being able to add or delete. I have set the permissions to every possible combination in IIS and in Windows. I can't get it to work no matter what. Any suggestions?
(If this comment was disrespectful, please report it.)

 
8/26/2004 7:47:50 AM

Did you via explorer, right-click on the catalogue where the database is at, select Properties, Web Sharing, and select Share this folder ? Make sure it has Read/Write access
(If this comment was disrespectful, please report it.)

 
8/26/2004 7:59:28 AM

If you want to know how to add more fields then just "name", email me and ill give you the code and explain. It's really simple but it can be hard to understand if you're really new. I can't explain it here since the site doesn't allow script code/html posting in this comments section.

My email: keyzersoze@swipnet.se
(If this comment was disrespectful, please report it.)

 
8/26/2004 8:00:27 AM

I mean it can be hard to understand how to add more fields from the original code
(If this comment was disrespectful, please report it.)

 
12/19/2005 10:32:41 AMIrah

Thanx Boss...
Good one for starters.
regards...
(If this comment was disrespectful, please report it.)

 
3/29/2007 6:52:23 AMziad

good source code please put a flash simple
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.