Go Back   SitePoint Forums > Forum Index > Program Your Site > Classic ASP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Sep 10, 2004, 21:47   #1
Wan
SitePoint Enthusiast
 
Wan's Avatar
 
Join Date: Sep 2004
Location: kl
Posts: 42
syntax error (missing operator)

I have try change (WHERE bil "= ) so many times. I search forum that have same problem but didn't find what's the problems.

<%
Dim nilai, catatan, cadangan, status
Dim sConnString, conn, sSQL
nilai = Request.Form("hiddenfield")
catatan = Request.Form("S1")
cadangan = Request.Form("D1")
status = Request.Form("C1")

sConnString = "PROVIDER = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = "& Server.MapPath("sistem.mdb")
sSQL = "UPDATE mohon SET "
sSQL = sSQL & "catatan = '" & catatan & "',"
sSQL = sSQL & "cadangan = '" & cadangan & "',"
sSQL = sSQL & "lulus = '" & status & "'"
sSQL = sSQL & " WHERE Bil = " & nilai

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open(sConnString)
conn.execute(sSQL)
conn.Close
Set conn = Nothing
%>

Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'Bil ='.
line 22 'at sSQL = sSQL & " WHERE Bil = " & nilai

I hope any members here can help me...!
Wan is offline   Reply With Quote
Old Sep 10, 2004, 22:33   #2
kgh
SitePoint Guru
 
Join Date: Sep 2003
Location: San Diego, CA
Posts: 604
is it...
Code:
WHERE Bil = '" & nilai & "'"
Notice the '
kgh is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 19:19.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved