SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 4th, 2003, 10:29 AM
Digitalosophy Digitalosophy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 74 Digitalosophy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 25 m 20 sec
Reputation Power: 6
Problem Inserting When Blank Field

I couldn't find a search or solution on the net or these forums for this problem. Here's what's going on. I have a form that passes values to my asp page which then inserts the data into my MS Access database. Ok. Everything works fine but.. There is a checkbox in my form. When checked everything wokrs fine. When not checked I get a page cannot be displayed, with no error message with what line is wrong. How can I get around this problem? Here's my code

Code:
<%@ Language="VBScript" %>
<%
	Dim strName, strEmail, strMessage
	strName = Request.Form("name")
	strEmail = Request.Form("email")
	strMessage = Request.Form("message")
	strPrivate = Request.Form("private")	
%>

	<!--#include file="connection.asp"-->

	<% SQL = "INSERT INTO faq (name, email, question, public) VALUES ('"&strName&"','"&strEmail&"','"&strMessage&"', '"&strPrivate&"')" %>

	<% Set r = conn.Execute(SQL) %>


Thanks in advance for any solution

[edit] Let me add to this. Idealy i would like if the checkbox is not checked to insert "private" into my database, is this possible?[/edit]

Last edited by Digitalosophy : August 4th, 2003 at 10:32 AM.

Reply With Quote
  #2  
Old August 4th, 2003, 11:24 AM
nopoints nopoints is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Windsor ON, Canada
Posts: 459 nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level)nopoints User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 44 m 22 sec
Reputation Power: 8
In the database does the Public field Allow Zero Length?

for your edited part compare the value of strPrivate. if it is checked then strPrivate will have a value. if it has that value then change it to Private. if not change it to something else.
__________________
Programmer's Corner

Reply With Quote
  #3  
Old August 4th, 2003, 11:40 AM
Digitalosophy Digitalosophy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 74 Digitalosophy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 25 m 20 sec
Reputation Power: 6
No points, omg I can't believe I didn't think of that, thank you very much

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Problem Inserting When Blank Field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway