Print Page | Close Window

error in inserting into db

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6698
Printed Date: 31 March 2026 at 11:59am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: error in inserting into db
Posted By: chakad
Subject: error in inserting into db
Date Posted: 25 October 2003 at 3:26am

hi all

This is my sql query and it cuase error when the "dimand" felid is empty.

strsql = "insert into  user (name ,no_parvande, tel, c_post, s_post, mail, add, tarefe, dimand)  VALUES ("
strsql = strsql & "'" & name & "' , "
strsql = strsql & "'" & no_parvande & "' ,"
strsql = strsql & "'" & tel & "' ,"
strsql = strsql & "'" & c_post & "' ,"
strsql = strsql & "'" & s_post & "' ,"
strsql = strsql & "'" & mail & "' ,"
strsql = strsql & "'" & add & "' ,"
strsql = strsql & "'" & tarefe & "',"
strsql = strsql &  dimand  & ")"

dimand type is numeric and the others have text type.

please help me




Replies:
Posted By: Mart
Date Posted: 25 October 2003 at 5:47am

Either set dimand to 0 or someting if it wasnt filled in or change the field settings from 'required' to 'not required'.

Mart.



Posted By: chakad
Date Posted: 25 October 2003 at 10:19am

thx for ur help

i use access db,and i set the fileld property to "not required"

but it cuase syntax error  when i'm testing my query result in access(as a query in sql view)

can anyone tell me how to change my query to do right with empty filled?

 



Posted By: michael
Date Posted: 25 October 2003 at 2:07pm
It causes an error cause it tries to insert ....'NULL' in case the filed is empty and that is not allowd. Define your variables and set them to '' if the Request has not value.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net