Hi I have a problem I've been struggling with for a long time
Pls help me with this
I get the following error :
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'id='.
the error is on this line:
RS.Open "SELECT * FROM aanpassingenPrio WHERE id=" & id
this is the update page:
<%
' Get the Product ID
id = Request( "pid" )
' Open the Database Connection
sConnStats = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../klantDB.mdb")
set conn = Server.CreateObject("ADODB.Connection")
conn.open sConnStats
if request.ServerVariables("REQUEST_METHOD")="POST" then
sql="update aanpassingenPrio set "& _
" prioriteit = '" &request.Form("prioriteit") & "' , " & _
" stat = '"&request.Form("stat")&"'," & _
" aanpassing = '"&request.Form("aanpassing")&"'," & _
" commentaar = '"&request.Form("commentaar")&"'" & _
" opleverdatum = '"&request.Form("opleverdatum")&"'" & _
" toevoeger = '"&request.Form("toevoeger")&"'" & _
" where id="&request.form("id")
conn.execute(sql)
'response.write sql : response.end
end if
' Open the Recordset
set rs = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = conn
RS.CursorType = 3
RS.Open "SELECT * FROM aanpassingenPrio WHERE id=" & id
IF NOT RS.EOF THEN
prioriteit = RS( "prioriteit" )
stat = RS( "stat" )
aanpassing = RS( "aanpassing" )
commentaar = RS( "commentaar" )
opleverdatum = RS( "opleverdatum" )
toevoeger = RS( "toevoeger" )
END IF
' Assign Default Values nodig om niet ingevulde velden toch een value te geven
IF commentaar = "" THEN
commentaar = "geen commentaar"
END IF
IF prioriteit = "" THEN
prioriteit = "Null"
END IF
IF stat = "" THEN
stat = "Null"
END IF
IF opleverdatum = "" THEN
opleverdatum = "Null"
END IF
' Close the Recordset
RS.Close
FUNCTION SELECTED( firstVal, secondVal )
IF cSTR( firstVal ) = cSTR( secondVAL ) THEN
SELECTED = " SELECTED "
END IF
END FUNCTION
%>
<html>
What goes around comes around