|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
No points, omg I can't believe I didn't think of that, thank you very much
![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Problem Inserting When Blank Field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|