Solved

ASP problem, please help me !

Posted on 1998-12-26
17
146 Views
Last Modified: 2010-04-09
Big problem when I try to update an existing field with SQL.

      numero = request.querystring("numero")    

      auteur=Request.Form("auteur")
      news=Request.Form("news")
      titre=Request.Form("titre")
      heure=Request.Form("heure")
      sDate=Request.Form("sDate")
      images1=Request.Form("images1")
      images2=Request.Form("images2")
      images3=Request.Form("images3")
      images4=Request.Form("images4")
      images5=Request.Form("images5")
      images6=Request.Form("images6")

update1 = "UPDATE News SET auteur = "& auteur &", news = '"& news &"' ,titre = '"& titre &"', heure = '"& heure &"', date = '"& sDate &"', images1 = '"& images1 &"', images2 = "& images2 &", images3 = "& images3 &", images4 = "& images4 &", images5 = "& images5 &", images6 = "& images6 &" WHERE numero2 = "& numero &""


I don't know... i declare the variable.... it say me : the content of auteur is a missing operator or somthing like this.....
Please help me !!! 200 POINTS !!!!!!

Nic
0
Comment
Question by:nicjac
  • 6
  • 6
  • 3
  • +2
17 Comments
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
will you please email me the database and you asp page?  I will take a look and let you know.
0
 

Expert Comment

by:thorner
Comment Utility
What are the fields defined as? Text, Number, Etc....?
0
 

Author Comment

by:nicjac
Comment Utility
This is Text definied Fileds

0
 

Expert Comment

by:thorner
Comment Utility
Make sure that you have a single quote and then a double quote around each variable.  It looks like you might not have them. Something like this: "UPDATE News SET auteur = '" & auteur & "', news = '" & news & "', etc....    Only put the "'" around textfields, other fields such as Date/Time and Numbers don't need them.
0
 

Author Comment

by:nicjac
Comment Utility
That do not work... can I send my DB and the ASP page to anyone ? PLease !!!!! ;)

Nic
0
 

Expert Comment

by:thorner
Comment Utility
Send it to me.  I'll fix it right up.  Send me a copy of the db also.  thorner@bsa3.kent.edu
0
 

Author Comment

by:nicjac
Comment Utility
I have receive nothing on answer of my mails.... please answer me !! This is very important

Nic
0
 
LVL 2

Expert Comment

by:vendrig
Comment Utility
Are you using any special characters as value for the auteur variable, when you're testing? Like accent aigu or quotes or so.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
I am almost finished with the ASP.  I will send it back sometime today.
0
 
LVL 6

Expert Comment

by:PBall
Comment Utility
It's good to run a request.form value thru somekind of a filter before finally committing it to the database.  One necessary filter that comes to mind when dealing with text field is the apostrophe to double apostrophes.

Author = Replace(Request.Form("Author"),"'","''")

Another field type that might need conversion is the datetime field.

Normally, if the form field itself already formatted correctly this will not matter, but since we can't really be sure about this, we might as well do a conversion ourself just to be cautious.

A simplest way to convert the date field is just to convert it using VBScript cDate function, althought this might not work all the time depending on the data entered.
PublishDate = cDate(Request.Form("PublishDate"))

I did my own conversion routine for datetime field that will generate a SQL friendly datetime string field.

i.e.  11/20/1998 to Nov 11 1998

Datetime input can be a pain in the butt sometimes.  I ended up coding an ASP/JavaScript Calendar control component to tackle this problem.  So far, it works for me.  I don't have to do any validation on the datetime field anymore :)

You can find the component at http://www.developer.com/directories/pages/dir.activeserverpages.components.commercialcomponents.miscellaneous.2.html

0
 
LVL 10

Accepted Solution

by:
MasseyM earned 200 total points
Comment Utility
I sent you the completed ASP file.  All is well now.  Please review the ASP and grade the answer.
0
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
nicjak, I am still writing the survey.   I will send it to you when complete.  You have an email address?
0
 

Author Comment

by:nicjac
Comment Utility
I need no more a Survey
I want a Search Engine now :)
I can't do that
Help me !

Nic
0
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
No problem.  Do you want to search a database or all the files on your web?
0
 

Author Comment

by:nicjac
Comment Utility
I want to search a database :)

Nic
0
 
LVL 10

Expert Comment

by:MasseyM
Comment Utility
Give me your e-mail.  I'll send it to you at the end of the weekend.
0
 

Author Comment

by:nicjac
Comment Utility
nicjac@deckpoint.ch
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now