Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - web form entry to access database w/asp
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

web form entry to access database w/asp

 Post Reply Post Reply Page  <123
Author
bassy View Drop Down
Newbie
Newbie


Joined: 11 April 2003
Location: Netherlands
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote bassy Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2003 at 2:11am

Hi swatson,

you have

first to:'Set up variables to receive the information from the form

Facility_id=Request.Form("Facility_id")
Facility_name=Request.Form("Facility_name")
Facility_description=Request.Form("Facility_description")
Street_address1=Request.Form("Street_address1")
Street_address2=Request.Form("Street_address2")
City=Request.Form("City")
State=Request.Form("State")
Zipcode=Request.Form("Zipcode")
Website=Request.Form("Website")
Image=Request.Form("Image")

after to:

sql_insert="insert into Facility (Facility_id, Facility_name, Facility_description, Street_address1, Street_address2, City, State, Zipcode, Website, Image) VALUES" & _
 "(Facility_id, Facility_name, Facility_description, Street_address1, Street_address2, City, State, Zipcode, Website, Image);"

It seem to me you r trying to insert empty variables. You must set up Variables before use them for anything, otherwise they are empty.

good look


Back to Top
swatson View Drop Down
Newbie
Newbie


Joined: 11 April 2003
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote swatson Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2003 at 10:29am

Thanks for suggestion, Bassy.  Although, I'm executing the sql_insert later -- after setting up the variables to get info from the form -- in the file, using conn.Execute sql_insert

I did try to move the initial sql_insert statement to after setting up the variables to get info from the form but that didn't seem to matter.  I got the same error.  Any other ideas out there?

Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2003 at 10:16pm

Your variables need to be escaped from your string:

sql_insert = "INSERT INTO...... VALUES ('" & Facility_ID & "','" _
    & Facility_name & "','" &  Facility_description & .... )"

Whenever a database call fails you should ALWAYS check to see exactly *what* is being sent to the database.

You can do this by performing a:
Response.Write (sql_Insert)
Response.End
after you have built your string.

Cheers,
Andrew

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
 Post Reply Post Reply Page  <123

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.