Solved

ASP problem, please help me !

Posted on 1998-12-26
17
153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
  • 3
  • +2
17 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1841013
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
ID: 1841014
What are the fields defined as? Text, Number, Etc....?
0
 

Author Comment

by:nicjac
ID: 1841015
This is Text definied Fileds

0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

Expert Comment

by:thorner
ID: 1841016
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
ID: 1841017
That do not work... can I send my DB and the ASP page to anyone ? PLease !!!!! ;)

Nic
0
 

Expert Comment

by:thorner
ID: 1841018
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
ID: 1841019
I have receive nothing on answer of my mails.... please answer me !! This is very important

Nic
0
 
LVL 2

Expert Comment

by:vendrig
ID: 1841020
Are you using any special characters as value for the auteur variable, when you're testing? Like accent aigu or quotes or so.
0
 
LVL 10

Expert Comment

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

Expert Comment

by:PBall
ID: 1841022
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
ID: 1841023
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
ID: 1841024
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
ID: 1841025
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
ID: 1841026
No problem.  Do you want to search a database or all the files on your web?
0
 

Author Comment

by:nicjac
ID: 1841027
I want to search a database :)

Nic
0
 
LVL 10

Expert Comment

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

Author Comment

by:nicjac
ID: 1841029
nicjac@deckpoint.ch
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

717 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