05. februar 2004 - 14:42
Der er
14 kommentarer og 1 løsning
Syntax error (missing operator)
Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'id='. /XXX/XXX.asp, line 132 den fejl forekommer... hvad dælen betyder den
Annonceindlæg fra Computerworld
06. februar 2004 - 11:44
#1
Hvornår dukker den op?
06. februar 2004 - 13:12
#2
<% if session("userid") = "" then %> <form action='godkend.asp' method='post' name='login'><font color='#C0C0C0' size='1' face='Verdana'><font size='1' color='#c0c0c0'>User:</font><br><input type='text' name='brugernavn' style='border:3px inset #808080; FONT-SIZE: 10px; FILTER: alpha(opacity =65); COLOR: #99BF00; BACKGROUND-COLOR: #3D3D3D' size='13' align='middle'> <font size= '1' color='#c0c0c0'><br>Password:<br><input type='password' name='password' style='border:3px inset #808080; FONT-SIZE: 10px; FILTER: alpha(opacity =65); COLOR: #99BF00; BACKGROUND-COLOR: #3D3D3D' size='16'></font><br><br><input type='submit' value='Enter now' name='submit' style='BORDER-RIGHT: #808080 1px ridge; BORDER-TOP: #808080 1px ridge; FONT-SIZE: 10px; FILTER: alpha(opacity =65); BORDER-LEFT: #808080 1px ridge; COLOR: #c0c0c0; BORDER-BOTTOM: #808080 1px ridge; BACKGROUND-COLOR: #3d3d3d'></form>Not user ?<br><b><a href='ny.asp'><font color='#c0c0c0'>Create account</a></b><br><br><img src='grafik/sponsers.gif'><br><img style=' FILTER: alpha(opacity =50);' src='grafik/Sponsere/webpartner.gif'><br><br><img style=' FILTER: alpha(opacity =50);' src='grafik/Sponsere/teflonlogony.jpg'><br><br><img style=' FILTER: alpha(opacity =50);' src='grafik/Sponsere/ghlogo.gif'></td> <% Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath ("databaser\users.mdb") Conn.Open DSN Dim samletAntal strSQL = "SELECT * FROM brugere WHERE id=" & session("userid") Set rs = Conn.Execute(strSQL) 'else 'Response.Write "Intet endnu!!!" end if %> I denne her sætning
06. februar 2004 - 13:36
#3
Prøv at rette strSQL = "SELECT * FROM brugere WHERE id=" & session("userid") til strSQL = "SELECT * FROM brugere WHERE id = '" & session("userid") & "'"
06. februar 2004 - 15:44
#4
nope det virker ikke :(
06. februar 2004 - 16:59
#5
Nej du har vel både userid og id som tal, men du spørger: If session("userid") = "" then .... strSQL = "SELECT * FROM brugere WHERE id=" & session("userid") Else ... End if Skal det ikke være: If session("userid") <> "" then ?
07. februar 2004 - 12:34
#6
Den kommer stadigvæk med denne fejl... når man er logget ind Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. /dom/sidemenu_h.asp, line 22 -------------------------Selve koden--------------------------------------- <% if session("userid") <> "" then Response.Write "You are logged in :)" Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath ("databaser\users.mdb") Conn.Open DSN Dim samletAntal strSQL = "SELECT * FROM brugere WHERE id = '" & session("userid") & "'" Set rs = Conn.Execute(strSQL) else Response.Write "<form action='godkend.asp' method='post' name='login'><font color='#C0C0C0' size='1' face='Verdana'><font size='1' color='#c0c0c0'>User:</font><br><input type='text' name='brugernavn' style='border:3px inset #808080; FONT-SIZE: 10px; FILTER: alpha(opacity =65); COLOR: #99BF00; BACKGROUND-COLOR: #3D3D3D' size='13' align='middle'> <font size= '1' color='#c0c0c0'><br>Password:<br><input type='password' name='password' style='border:3px inset #808080; FONT-SIZE: 10px; FILTER: alpha(opacity =65); COLOR: #99BF00; BACKGROUND-COLOR: #3D3D3D' size='16'></font><br><br><input type='submit' value='Enter now' name='submit' style='BORDER-RIGHT: #808080 1px ridge; BORDER-TOP: #808080 1px ridge; FONT-SIZE: 10px; FILTER: alpha(opacity =65); BORDER-LEFT: #808080 1px ridge; COLOR: #c0c0c0; BORDER-BOTTOM: #808080 1px ridge; BACKGROUND-COLOR: #3d3d3d'></form>Not user ?<br><b><a href='ny.asp'><font color='#c0c0c0'>Create account</a></b><br><br><img src='grafik/sponsers.gif'><br><img style=' FILTER: alpha(opacity =50);' src='grafik/Sponsere/webpartner.gif'><br><br><img style=' FILTER: alpha(opacity =50);' src='grafik/Sponsere/teflonlogony.jpg'><br><br><img style=' FILTER: alpha(opacity =50);' src='grafik/Sponsere/ghlogo.gif'></td>" end if %>
07. februar 2004 - 12:46
#7
if id in the database is a number then you should use strSQL = "SELECT * FROM brugere WHERE id = " & session("userid") '' is for text fields!
07. februar 2004 - 13:13
#8
thanx hvad med den her: Microsoft OLE DB Provider for ODBC Drivers error '80040e07' [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. /dom/start.asp, line 146 ----------------------------------Code here---------------------------------- if session("userid") <> "" then Response.Write "</center>" & vbCrLf Response.Write "<form action=" & Chr(34) & Request.ServerVariables("PATH_INFO") & "?function=comment&id=" & ID & Chr(34) & " method=""post"">" & vbCrLf Response.Write "<textarea name=""Kommentar"" class=""Text"" cols=49 rows=4 style=""border:1px solid #000000;"">You can give a comment here if you want. </textarea><br> " & vbCrLf Response.Write "<font size=""1"" font face=""verdana"" color=""#808080"">Name :<br>" & vbCrLf Response.Write "<input class=""Text"" name=""Navn"" type=text size=18 style=""border:1px solid #000000; ""><br>" & vbCrLf ' Response.Write "<font size=""1"" color=""#808080"">E-mail :<br>" & vbCrLf ' Response.Write "<input class=""Text"" name=""email"" type=text size=30 style=""border:1px solid #000000; ""><br>" & vbCrLf Response.Write "<br>" & vbCrLf Response.Write "<input class=""Button"" type=submit value=""Comment!"" style=""color: #C0C0C0; border: 1px outset #C0C0C0; background-color: #808080; font-size:8pt; font-family:Verdana; font-weight:bold"">" & vbCrLf Response.Write "</form>" & vbCrLf Set Conn = Server.CreateObject("ADODB.Connection") DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " DSN = DSN & "DBQ=" & Server.MapPath ("databaser/users.mdb") Conn.Open DSN Dim samletAntal strSQL = "SELECT * FROM brugere WHERE id = '" & session("userid") & "'" Set rs = Conn.Execute(strSQL) else Response.Write " <b>You are not logged in, so you can't comment this news</b><br><br>" end if
07. februar 2004 - 14:05
#9
isnt it the same error? Dim samletAntal >>>>>>>>>>>>>>>> strSQL = "SELECT * FROM brugere WHERE id = " & session("userid") Set rs = Conn.Execute(strSQL)
07. februar 2004 - 14:15
#10
Yest its the same error
07. februar 2004 - 14:18
#11
Thanz man... you have solved me prob
07. februar 2004 - 14:18
#12
my prob
07. februar 2004 - 14:23
#13
your welcome
07. februar 2004 - 15:13
#14
hmmm... 06/02-2004 16:59:28 /hekla
07. februar 2004 - 15:55
#15
I noticed that too but "...id=" & ... isnt the same as "...id = " & ...
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser