473,466 Members | 1,286 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

correction d'une ligne de code

Bonjour,

Débutant en asp, mon navigateur me signale une faute dans cette ligne,
avec ces "" et ses '' je ne vois pas trop d'où viens l'erreur,
quelqu'un pourait-il m'aider? merci, pascal

La ligne est :

req_sql = UPDATE t_abo SET txtTransactionID=" &
request.form("txtTransactionID") & ", txtPayMet=" &
request.form('txtPayMet') & " WHERE ID=" & request('txtOrderIDShop')"
conn.Execute(req_sql)

----------------------------------------------------------------
Le code affiché par le navigateur est:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/e_confirmation_bd.asp, line 198

req_sql = UPDATE t_abo SET txtTransactionID=" &
request.form("txtTransactionID") & ", txtPayMet=" &
----------------------------^
request.form('txtPayMet') & " WHERE ID=" & request('txtOrderIDShop')"

Nov 9 '05 #1
6 1944
elia wrote on 09 nov 2005 in microsoft.public.inetserver.asp.general:
req_sql = UPDATE t_abo SET txtTransactionID=" &
req_sql = "UPDATE t_abo SET txtTransactionID='" &_
request.form("txtTransactionID") & ", txtPayMet=" &
request.form("txtTransactionID") & "', txtPayMet='" &_
request.form('txtPayMet') & " WHERE ID=" & request('txtOrderIDShop')"
request.form("txtPayMet") & "' WHERE ID=" & request("txtOrderIDShop")
conn.Execute(req_sql)


conn.Execute req_sql

NB if: ID: number, txtPayMet: string, txtTransactionID: string

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 9 '05 #2
You don't start your string with a ".

req_sql = UPDATE t_abo SET...."
vs.
req_sql = "UPDATE t_abo SET...."
Also, what's with request.form('txtPayMet') instead of
request.form("txtPayMet")?

Additionally:
http://www.google.com/search?hl=en&l...+sql+injection
http://www.aspfaq.com/show.asp?id=2111
Ray at work

"elia" <jo****@pcl.ch> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Bonjour,

Débutant en asp, mon navigateur me signale une faute dans cette ligne,
avec ces "" et ses '' je ne vois pas trop d'où viens l'erreur,
quelqu'un pourait-il m'aider? merci, pascal

La ligne est :

req_sql = UPDATE t_abo SET txtTransactionID=" &
request.form("txtTransactionID") & ", txtPayMet=" &
request.form('txtPayMet') & " WHERE ID=" & request('txtOrderIDShop')"
conn.Execute(req_sql)

----------------------------------------------------------------
Le code affiché par le navigateur est:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/e_confirmation_bd.asp, line 198

req_sql = UPDATE t_abo SET txtTransactionID=" &
request.form("txtTransactionID") & ", txtPayMet=" &
----------------------------^
request.form('txtPayMet') & " WHERE ID=" & request('txtOrderIDShop')"
Nov 9 '05 #3
Merci pour ces informations mais je n'y arrive toujours pas.
Le code comprends 3 imbrications, et donc " et ' ne suffisent pas!
J'ai essayé avec [ mais cela ne fonctionne pas non plus.
Mon probleme est d'ajouter deux variables (txtTransactionID ,
txtPayMet) pour un ID (txtOrderIDShop) qui proviennent d'un Post dans
une Base de donnée.

Ma ligne de code est maintenant :
req_sql = [UPDATE t_abo SET txtTransactionID=" &
request.form('txtTransactionID') &
", & txtPayMet=" & request.form('txtPayMet') " &
WHERE ID=" & request('txtOrderIDShop')"]

mais je reçois le message d'eureur suivant:
Microsoft OLE DB Provider for ODBC Drivers error '80040e0c'
Command text was not set for the command object.

merci.

Nov 10 '05 #4
elia wrote on 10 nov 2005 in microsoft.public.inetserver.asp.general:
req_sql = [UPDATE t_abo SET txtTransactionID=" &


Wrong, a string litteral should start with a "

req_sql = "UPDATE t_abo SET txtTransactionID="

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 10 '05 #5
Ok, je commence avec :
"update ....
mais après je suis embêter, comment faire 3 imbrications??

" ......'.....?.....?.....'....."

merci

Nov 10 '05 #6
elia wrote on 10 nov 2005 in microsoft.public.inetserver.asp.general:
Ok, je commence avec :
"update ....
mais aprŠs je suis embˆter, comment faire 3 imbrications??

" ......'.....?.....?.....'....."

merci


ASP-vbs needs ".. anything ...." as a litteral string

varNumber = 3
varString = ".. anything ...." & 3 & ".. anything ...."

SQL needs internal! string litterals in '...',
but the string itself needs the ASP-vbs "..." external

varNumber = 17
myTable = "TblFirst"
sqlString = "delete '" & myTable "' where id = " & varNumber

This will make a string in sqlString:

"delete 'TblFirst' where id = 17"

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Nov 10 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Agathe | last post by:
Bonjour, Je souhaite insérer dans une table MySQL des données provenant d'un fichier texte grâce à un script PHP. Mon fichier porte l'extension "txt" et les données sont séparées par des ";'. ...
0
by: SBA03 | last post by:
J'ai une vue de jointure bassée sur plusieurs tables, je peux mettre à jour cette vue grâce à un trigger instead of. Je voudrai charger un fichier csv dont la structure est basée sur celle de ma...
1
by: manu | last post by:
Bonjour, Sous visual c++ 6, c'était très simple de surcharger une virtual d'une MFC, c'était automatiquement fait. (il mettais une ligne dans MESSAGE_MAP, puis le corps de la fonction,etc...) ...
2
by: Peter Knowfield | last post by:
Bonjour à tous, Je développe une base traitant des candidatures pour des jobs. J'ai créer des requetes me donnant des listings d'individus selon des critères, et je désire pouvoir accéder...
0
by: nobody | last post by:
Bonjour, J'avais posté un message il n'y a pas si longtemps et j'avais pû être dépanné très rapidement :...
0
by: paulvz882 | last post by:
comprimes de acomplia en France commander acomplia en ligne aucune prescription acomplia canada soft en ligne +++ PERTE DE POIDS +++ PERTE DE POIDS +++ PERTE DE POIDS +++ + ACHETER DU ACOMPLIA...
0
by: jkjtjktjktjhktjk | last post by:
acheter du acomplia en ligne acomplia belgique suisse achat acomplia discret acomplia a vendre PERTE DE POIDS comprimes de acomplia canada acomplia belgique soft bon marche +++ PERTE DE POIDS...
0
by: jkjtjktjktjhktjk | last post by:
acheter du acomplia cinq acomplia par email PERTE DE POIDS en France acomplia canada soft en ligne acomplia belgique acomplia belgique bon marche acheter du acomplia en ligne sur internet +++...
0
by: sdgvfwe | last post by:
achat ampicillin canada a vendre comprimes de acheter ampicillin en France bon marche achat acheter ampicillin canada acheter ampicillin canada en ligne sur internet acheter ampicillin canada soft...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.