Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/web_project/show_ct_com.asp, line 38, column 249
SQLQuery="SELECT * FROM Qry_com Where computersn like '%" &computersn& "%' and computertype like '%" &computertype& "%'and brand like '%" &brand& "%' and computermodel like '%"& computermodel& "%' and speccpu like '%" &speccpu& "%' and hdd like '%" &hdd& "%' and ram like '%" &ram& "%'and macaddress like '%" &macaddress& "%'"
ส่วนนี้เป็น Code นะครับ
<%@ LANGUAGE="VBSCRIPT" %>
<script RUNAT="Server" LANGUAGE="VBScript">
</script>
<% dim computersn
dim computertype
dim brand
dim computermodel
dim speccpu
dim hdd
dim ram
dim macaddress
dim computername
ค่าของตัวแปร บางตัว มีอักขระที่ทำให้ query ประมวลผลผิดครับ
เท่าที่ดูและเดา น่าจะมีปัญหาที่ macaddress มีจุด อยู่หรือเปล่าครับ ลอง debug ดูก่อนหรือยังครับ
เช่น
<%
Set Obj = Server.CreateObject("ADODB.Connection")
obj.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="&server.MapPath("datacom.mdb")
set rsQuery=Server.CreateObject("ADODB.RecordSet")
SQLQuery="SELECT * FROM Qry_com Where computersn like '%" &computersn& "%' and computertype like '%" &computertype& "%'and brand like '%" &brand& "%' and computermodel like '%"& computermodel& "%' and speccpu like '%" &speccpu& "%' and hdd like '%" &hdd& "%' and ram like '%" &ram& "%'and macaddress like '%" &macaddress& "%'"
'SQLQuery="SELECT * FROM Qry_com "
on error resume next
response.write "SQLQuery = <br>" & vbcrlf & SQLQuery
SQLQuery="SELECT * FROM Qry_com Where computersn like '%" &computersn& "%' "&_
" and computertype like '%" &computertype& "%' and brand like '%" &brand& "%' "&_
" and computermodel like '%"& computermodel& "%' and speccpu like '%" &speccpu& "%' "&_
" and hdd like '%" &hdd& "%' and ram like '%" &ram& "%' and macaddress like '%" &macaddress& "%'"
Date :
21 พ.ค. 2551 14:50:14
By :
MuaY
No. 4
Guest
เช็คตามหมดแล้วนะครับ แต่ก็ยังไม่ได้ขึ้น error
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/web_project/show_ct_com.asp, line 36, column 249
SQLQuery="SELECT * FROM Qry_com Where computersn like '%" &computersn& "%' and computertype like '%" &computertype& "%' and brand like '%" &brand& "%' and computermodel like '%"&computermodel& "%' and speccpu like '%" &speccpu& "%' and hdd like '%" &hdd& "%' and ram like '%" &ram& "%' and macaddress like '%" &macaddress& "%'"
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^