Home | Advertising Info6 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Saturday, April 27, 2024  

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - Database Issues
 PowerASP Code Help Area : Classic ASP - Database Issues
Subject Topic: Update Access Database Problem Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dev2501
Newbie
Newbie
Avatar

Joined: June/24/2007
Location: United Kingdom
Online Status: Offline
Posts: 1
Posted: June/24/2007 at 9:16am | IP Logged Quote dev2501

Hi, I am trying to update a users profile using ASP - the database is access. My problem is that my script returns the same result everytime and I am not sure on what to do now - with the absence of any error!

my asp script:


<%
Dim Username,Salutation1,fname1,sname1,organisation_name,line1,l ine2,line3,line4,post_town,county,postcode,Country,tnumber1, mnumber1,email1
Username=request.form("username")
Salutation= Request.Form("Salutation1")
fname1=request.form("fname1")
sname1=request.form("sname1")
organisation_name=request.form("organisation_name")
line1=request.form("line1")
line2=request.form("line2")
line3=request.form("line3")
line4=request.form("line4")
post_town=request.form("post_town")
county=request.form("county")
postcode=request.form("postcode")
Country=request.form("Country")
tnumber1=request.form("tnumber1")
mnumber1=request.form("mnumber1")
email11=request.form("email11")
%>
<%
if username="" or Salutation1="" or fname1="" or sname1="" or line1="" or post_town="" or county="" or postcode="" or Country="" or tnumber1="" or mnumber1="" or email11="" then
on error resume next
Response.Write "A field was left empty, please try again!"
if err.number <> 0 then response.write err.description
Else
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("mydatabase"))
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT DISTINCT Username FROM Address ORDER BY Username"
rs.Open sql,conn
Username=Session("username")

if Username<>"" or Salutation1="" or fname1="" or sname1="" or line1="" or post_town="" or county="" or postcode="" or Country="" or tnumber1="" or mnumber1="" or email11="" then
sql= "Update Address Set Username='"& Username &"', Salutation1='"& Salutation1 & "',fname1='"& fname1 &"', sname1='"& sname1 &"',organisation_name='" & organisation_name &"', line1='" & line1 &"',line2='" & line2&"',line3='" & line3&"',line4='" & line4&"',post_town='" & post_town&"',county='" & county&"',postcode='" & postcode&"',Country='" & Country&"',tnumber1='" & tnumber1&"',mnumber1='" & mnumber1 &"', email11='" & email11&"'  WHERE username=" & username
Conn.Close
Set Rs=Nothing
Set Conn = Nothing

on error resume next
Response.Write "Successfully Updated"
if err.number <> 0 then response.write err.description

End If
end if
%>

The message that I get is:

A field was left empty, please try again! 

I have entered data into all of the text fields on the update page.

How would I exclude a column from editing using the asp script?

Am I getting this error because the database holds more columns than I am trying to edit?

Regards

mal

 



__________________
If you can think of it! someone else will have already thought of and implemented the solution.
Back to Top View dev2501's Profile Search for other posts by dev2501 Visit dev2501's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages what is asp programming how to sample asp example code scripts software asp forum mail sessions applications global.asa CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com