Problème avec du code asp
Bonjours à tous
J'ai un petit problème ave un script en ASP voici un erreur que j'obtien
Code:
1 2 3 4 5
| Microsoft JET Database Engine erreur '80040e14'
Erreur de syntaxe (virgule) dans l'expression 'j=11, 24 and m=10, 2 and a=2007, 2005 and element='a104' and annule=false'.
/chenebleu/informatique/images/cardinal112/reservelocal/ok.asp, ligne 154 |
Explication:
Je dois développez un script qui ajoute un enregistrement à ma base de donnée et lorsque on appuie sur un boutton, un autre champ apparait.
Quand j'envoie une requête sans ajouter de champ tout fonctionne super bien
Je vous montre le code qui cause problème... Selon moi ...
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <%
...
if instr(j,",")>0 then
j= Split(j,",", -1, 1)
m= Split(m,",", -1, 1)
a= Split(a,",", -1, 1)
For i = 0 to Ubound(i) step 1
%>
<%
next
end if
%> |
Et finalement voici le code de connexion à la base de donnée aux alentours de la ligne 154:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| <%
dsn ="DBQ="&Server.Mappath("./db/resa.mdb")&";Driver={Microsoft Access Driver(*.mdb)};"
dsn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("./db/xxxxxxxxxxxxxxxxxx.mdb")&";"
' VERIFIE SI L'ÉLÉMENT À DÉJA ÉTÉ RÉSERVÉ
response.buffer = true
'declaration
dim useraction
dim conn,dsn,rs,sql
'if the user submit the form
useraction = request("action")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open dsn
SQL = "SELECT * FROM reservation WHERE j=" & j & " and m=" & m & " and a=" & a & " and element='" & elements & "' and annule=false order by element ASC"
rs.open sql,conn
if Not RS.EOF then
isP1 = false
isP2 = false
isMidi = false
isP3 = false
isP4 = false
isSoir = false
Do While Not RS.EOF
if RS("periode1") then
isP1=true
end if
if RS("periode2") then
isP2=true
end if
if RS("midi") then
isMidi=true
end if
if RS("periode3") then
isP3=true
end if
if RS("periode4") then
isP4=true
end if
if RS("soiree") then
isSoir=true
end if
RS.MoveNext
loop
end if
isResValide = true
if isP1 and peri1 = "on" then
isResValide = false
end if
if isP2 and peri2 = "on" then
isResValide = false
end if
if isMidi and midi = "on" then
isResValide = false
end if
if isP3 and peri3 = "on" then
isResValide = false
end if
if isP4 and peri4 = "on" then
isResValide = false
end if
if isSoir and soir = "on" then
isResValide = false
end if
'if rs.eof and rs.bof then
if isResValide then
Randomize()
intRangeSize = 9999999 - 1000000 + 1
sngRandomValue = intRangeSize * Rnd()
sngRandomValue = sngRandomValue + intLowerBound
cle = Int(sngRandomValue)
Session("SID") = cle
%> |