Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : ASP : ASP 3.0 : Inserting to database problem Signup · Login
Author Thread
Inserting to database problem
Posted in tutorial: Create your own Newsletter in ASP 3.0
·  uga_ben
User
Joined: 27 Nov 2002
Total Posts: 3

Inserting to database problem

Posted: 27 Nov 2002
I have been fooling around with this code and everything works accept for inserting new records. Any ideas?
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 595
Re: Inserting to database problem
Posted: 27 Nov 2002
What kind of error message you get when you try to insert new records?

Faisal Khan.
Stardeveloper.com
Read Blog | Follow on Facebook, Twitter
·  uga_ben
User
Joined: 27 Nov 2002
Total Posts: 3
Re: Inserting to database problem
Posted: 27 Nov 2002
I get the following error in explorer: HTTP 500 - Internal server error.
If I comment out the insert statement it goes through the rest of the code fine or if I avoid the insert (by typing in an email address that is already present in the database).

Thanks
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 595
Re: Inserting to database problem
Posted: 4 Dec 2002
You are not telling the error message, probably you are seeing only "HTTP 500 - Internal Server Error" message.

Do this:

In Internet Explorer go to Tools -> Internet Options -> Advanced ( Tab ) -> Browsing: Show friendly HTTP error messages.

Uncheck this "Show friendly HTTP error messages" option.

Try running the newsletter script again, and this time you should see the real error message, and that is the error message that I want you to post here for me to analyze what may have gone wrong.

Faisal Khan.
Stardeveloper.com
Read Blog | Follow on Facebook, Twitter
·  uga_ben
User
Joined: 27 Nov 2002
Total Posts: 3
Thank you
Posted: 18 Dec 2002
Thank you for your help. It is much appreciated. I figured out the folder my db was in was read-only, I felt stupid.

But I have another question. When I use the admin script to send an email. It loops through fine and sends the emails out properly until it gets to a bad email address. Then evidently it quits, because any valid email addresses following the bad one in the db do not receive the email.

Any ideas on this one?

Thanks again,
Ben
·  Faisal Khan
AdminAdminAdminAdmin
Joined: 24 Sep 2002
Total Posts: 595
Re: Thank you
Posted: 24 Dec 2002
You'll have to use VBScript error handling like this:


<%
On Error Resume Next

' .. Put all the email code here e.g While...Wend

If Err.Number = 0 Then
Response.Write "Email Sent"
Else
Response.Write "Something went wrong : " & Err.Description
End If
%>

Faisal Khan.
Stardeveloper.com
Read Blog | Follow on Facebook, Twitter
·  TESolutions
User
Joined: 21 Jan 2003
Total Posts: 1
Problems Inserting Record into Database
Posted: 21 Jan 2003
Hi I am a newbie to using ASP so please be patient. I have followed your instructions in the article but I am getting the following error message when trying to add a new email address:

Microsoft JET Database Engine error '80004005'

Operation must use an updateable query.

/test/mail_ac.asp, line 24

Line 24 of the code is as follows:
con.Execute sql_insert

I can't understand why this is happening and would be grateful for any help!
·  diggemup
User
Joined: 20 Feb 2003
Total Posts: 1
Re: Operation must use an updateable query
Posted: 20 Feb 2003
This error is because your DB does not have write permissions. Give that file Read/Write permission, and you'll be fine.
Want to leave a comment? Login or Register for free!

Users Who Have Visited This Thread In Last 24 Hours
2 Visitors

Login to post a comment or start a new thread
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.