Solved

ASP problem, please help me !

Posted on 1998-12-26
17
148 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
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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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…

803 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