Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

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 ASP Free Forums Sponsor:
  #1  
Old April 10th, 2004, 11:52 AM
tbourworld tbourworld is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 tbourworld User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post <b>HELP</b> Updating DB and it does nothing

I submit my form, and it goes to the response.redirect page. But it is not updating the DB... Can someone shine a light my way?

VERIFYING.ASP: (hidden page)
<%

dim upSQL,rs,objConn,connStr

'Server Side form validation to keep our database clean

dim directorfname,directorlname,directoremail,address1 ,address2,city,state,zipcode,phone,directorpasswor d

'Save entered data from verify

directorfname = Request.Form("directorfname")

directorlname = Request.Form("directorlname")

directoremail = Request.Form("directoremail")

address1 = Request.Form("address1")

address2 = Request.Form("address2")

city = Request.Form("city")

state = Request.Form("state")

zipcode = Request.Form("zipcode")

phone = Request.Form("phone")

directorpassword = Request.Form("directorpassword")



'Check if Fields are empty

if directorfname = "" then Response.write("Invalide Director First Name <A HREF=javascript:history.go(-1)>Go Back</A><br>")

if directorlname = "" then Response.write("Invalide Director Last Name <A HREF=javascript:history.go(-1)>Go Back</A><br>")

if directoremail = "" then Response.write("Invalide Director Email Address <A HREF=javascript:history.go(-1)>Go Back</A><br>")

if address1 = "" then Response.write("Invalide Address <A HREF=javascript:history.go(-1)>Go Back</A><br>")

if city = "" then Response.write("Invalide City <a HREF=javascript:history.go(-1)>Go Back</A><br>")

if state = "" then Response.write("Invalide State <A HREF=javascript:history.go(-1)>Go Back</A><br>")

if zipcode = "" then Response.write("Invalide Zip Code <A HREF=javascript:history.go(-1)>Go Back</A><br>")

if phone = "" then Response.write("Invalide Phone Number <A HREF=javascript:history.go(-1)>Go Back</A><br>")

if directorpassword = "" then Response.write("Invalide Director Password <A HREF=javascript:history.go(-1)>Go Back</A><br>")

dim sname

sname= "" & Session("name") & ""



'Build connection

dbPath="users.mdb"

on error resume next

Set objConn = Server.CreateObject("ADODB.Connection") 'Set objConn as an Object

connStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & dbPath &";"

objConn.Open(connStr)



upSQL="UPDATE customers SET = customers.directorfname='" & rs("directorfname") & "', customers.directorlname='" & rs("directorlname") & "', customers.directoremail='" & rs("directoremail") & "', customers.address1='" & rs("address1") & "', customers.address2='" & rs("address2") & "', customers.city='" & rs("city") & "', customers.state='" & rs("state") & "', customers.zipcode='" & rs("zipcode") & "', customers.phone='" & rs("phone") & "', customers.directorpassword='" & rs("directorpassword") & "' WHERE customers.name= '"& (sname) &"'"

objConn.Execute(upSQL)

' objConn.Close

'Set objConn = Nothing



objConn.Close

Set oRS = Nothing

Set objConn = Nothing





Response.Redirect("review.asp")

%>


Last edited by tbourworld : April 10th, 2004 at 09:11 PM.

Reply With Quote
  #2  
Old April 10th, 2004, 11:57 AM
tbourworld tbourworld is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 tbourworld User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you in advance for your help

Reply With Quote
  #3  
Old April 14th, 2004, 11:36 AM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,760 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 5 h 18 m 17 sec
Reputation Power: 443
1) Make sure you are connecting to the database
Code:
Conn.Open ConnStr
Response.write(Conn.State)
Response.end
If Conn.State = 0, then you aren't connecting


2) Write your sql statement to the browser to make sure it is formatted properly and contains the correct values.
Code:
upSql = "your update statement"
Response.write(upSql)
Response.end

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > <b>HELP</b> Updating DB and it does nothing


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 2 hosted by Hostway