Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > ASP > ASP Forum > error นี้แก้ยังไงครับ 0x800A0401 Error Type: Microsoft VBScript compilation (0x800A0401) Expected end of statement



 

error นี้แก้ยังไงครับ 0x800A0401 Error Type: Microsoft VBScript compilation (0x800A0401) Expected end of statement

 



Topic : 020039

Guest




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


computersn=Request("computersn")
computertype=Request("computertype")
brand=Request("brand")
computermodel=Request("computermodel")
speccpu=Request("speccpu")
hdd=Request("hdd")
ram=Request("ram")
macaddress=Request("macaddress")
computername=Request("computername")

%>
<html>
<head>
<title>show data</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
</head>
<body>
<%
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 "
Set rsQuery=obj.Execute(SQLQuery)
%>
<div align="center">
<p><strong><font color="#666666" size="2">THAI CERAMIC CO.,LTD.</font></strong></p>
</div>
<table width="100%" border="0">
<tr>
<td><table width="100%"border="1" bgcolor="#ecf1f4">
<tr bordercolor="#FFFFFF" bgcolor="#003366">
<td colspan="15"><div align="center"><font color="#FF9900" size="2" face="ms Sans Serif"><strong>รายละเอียดคอมพิวเตอร์/พริ้นเตอร์</strong></font></div></td>
</tr>
<tr bordercolor="#ffffff" bgcolor="#99cccc">
<td width="9%"><div align="center"><font color="#666666" size="1" face="ms Sans Serif"><strong>รหัสเครื่อง</strong></font></div></td>
<td width="12%"><div align="center"><font color="#666666" size="1" face="ms Sans Serif"><strong>ชนิดอุปกรณ์</strong></font></div></td>
<td width="8%"><div align="center"><font color="#666666" size="1" face="ms Sans Serif"><strong>ยี่ห้อ</strong></font></div></td>
<td width="10%"><div align="center"><strong><font color="#666666" size="1" face="ms Sans Serif">รุ่น</font></strong></div></td>
<td width="8%"><div align="center"><font color="#666666" size="1" face="ms Sans Serif"><strong>CPU</strong></font></div></td>
<td width="10%"><div align="center"><font color="#666666" size="1" face="ms Sans Serif"><strong>Harddisk </strong></font></div></td>
<td width="8%"><div align="center"><font color="#666666" size="1" face="ms Sans Serif"><strong>Ram</strong></font></div></td>
<td width="9%"><div align="center"><font color="#666666" size="1" face="ms Sans Serif"><strong>Macaddress</strong></font></div></td>

</tr>
<%
CPos=0
DispQty=1300
%>
<% Do While Not rsQuery.EOF %>
<% If CPos>DispQty Then Exit Do
CPos=CPos+1
%>
<tr bordercolor="#cccccc" bgcolor="#ecf1f4">
<td width="9%"><font size="2" face="Microsoft Sans Serif"><%=rsQuery("computersn")%></font></td>
<td width="12%"><font size="2" face="Microsoft Sans Serif"><%=rsQuery("computertype")%></font></td>
<td width="8%"><font size="2" face="Microsoft Sans Serif"><%=rsQuery("brand")%></font></td>
<td width="10%"><div align="center"><font size="2" face="Microsoft Sans Serif"><%=rsQuery("computermodel")%></font></div></td>
<td width="8%"><div align="right"><font size="2" face="Microsoft Sans Serif"><%=rsQuery("speccpu")%></font></div></td>
<td width="10%"><div align="right"><font size="2" face="Microsoft Sans Serif"><%=rsQuery("hdd")%></font></div></td>
<td width="8%"><font size="2" face="Microsoft Sans Serif"><%=rsQuery("ram")%></font></td>
<td width="9%"><font size="2" face="Microsoft Sans Serif"><%=rsQuery("macaddress")%></font></td>

</tr>
<%
rsQuery.MoveNext
Loop
%>
</table></td>
</tr>
</table>

ช่วยด้วยครับแก้ยังไงก็ไม่ออกซะที


Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 19 พ.ค. 2551 14:48:25 By : narongsr View : 2067 Reply : 4
 

 

No. 1

Guest


ค่าของตัวแปร บางตัว มีอักขระที่ทำให้ 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

'Set rsQuery=obj.Execute(SQLQuery)
%>






Date : 19 พ.ค. 2551 17:33:47 By : GTM
 


 

No. 2

Guest


ผม กำหนดค่า Macaddress เป็น Text ธรรมดาครับ เช่น 0001fd7b8166 ครับ ไม่มีจุดเลยครับ มีข้อมูลตัวไหนที่น่าจะมีปัญหาอีกหรือป่าวครับ เกี่ยวกับ Code ถูกต้องหรือป่าวครับ ขอบคุณมากครับที่ช่วยแก้ Error
Date : 20 พ.ค. 2551 13:11:49 By : narongsr
 

 

No. 3

Guest


สังเกตุดีๆๆคำสั่ง sql คุน ตรง ' กับand ติดกัน ส่งผลให้เกิดคำสั่งผิดได้ กรุณาตรวจสอบให้ท่วนถี

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& "%'"
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^


แก้ยังไงครับ
Date : 23 พ.ค. 2551 16:27:52 By : narongsr
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : error นี้แก้ยังไงครับ 0x800A0401 Error Type: Microsoft VBScript compilation (0x800A0401) Expected end of statement
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่