为什么Access数据库中Count出错
统计记录数目,以下是代码,应该没有错吧,为什么老说语句未结束?错误类型:MicrosoftVBScript编译器错误(0x800A0401)语句未结束/1.asp,lin...
统计记录数目,以下是代码,应该没有错吧,为什么老说语句未结束?
错误类型:
Microsoft VBScript 编译器错误 (0x800A0401)
语句未结束
/1.asp, line 28, column 53
rs1.open "SELECT Count(*) AS TotalOrders FROM testb" Conn1,1,3
----------------------------------------------------^
Dim Conn1,rs1
Set Conn1=Server.CreateObject("ADODB.Connection")
Conn1.Open "Provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db1.mdb")
Set rs1=Server.CreateObject("ADODB.recordset")
rs1.open "SELECT Count(*) AS TotalOrders FROM testb" Conn1,1,3
response.write rs1("TotalOrders")
rs1.close
Set rs1=Nothing
Set Conn1=Nothing 展开
错误类型:
Microsoft VBScript 编译器错误 (0x800A0401)
语句未结束
/1.asp, line 28, column 53
rs1.open "SELECT Count(*) AS TotalOrders FROM testb" Conn1,1,3
----------------------------------------------------^
Dim Conn1,rs1
Set Conn1=Server.CreateObject("ADODB.Connection")
Conn1.Open "Provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db1.mdb")
Set rs1=Server.CreateObject("ADODB.recordset")
rs1.open "SELECT Count(*) AS TotalOrders FROM testb" Conn1,1,3
response.write rs1("TotalOrders")
rs1.close
Set rs1=Nothing
Set Conn1=Nothing 展开
1个回答
展开全部
Dim Conn1,rs1
Set Conn1=Server.CreateObject("ADODB.Connection")
Conn1.Open "Provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db1.mdb")
Set rs1=Server.CreateObject("ADODB.recordset")
rs1.open "SELECT Count(*) AS TotalOrders FROM testb",Conn1,1,3
response.write rs1("TotalOrders")
rs1.close
Set rs1=Nothing
Set Conn1=Nothing
仔细看:
rs1.open "SELECT Count(*) AS TotalOrders FROM testb" Conn1,1,3
这句少了个,
Set Conn1=Server.CreateObject("ADODB.Connection")
Conn1.Open "Provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db1.mdb")
Set rs1=Server.CreateObject("ADODB.recordset")
rs1.open "SELECT Count(*) AS TotalOrders FROM testb",Conn1,1,3
response.write rs1("TotalOrders")
rs1.close
Set rs1=Nothing
Set Conn1=Nothing
仔细看:
rs1.open "SELECT Count(*) AS TotalOrders FROM testb" Conn1,1,3
这句少了个,
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询