日期:2014-05-17  浏览次数:20910 次

ASP的一个问题?
能否解答一下这是什么错误吗?哪有原因呀?看着代码没错误的呀

错误类型:
Microsoft   VBScript   编译器错误   (0x800A0400)
缺少语句
/1000book/dbconn.asp,   line   2
option   explicit


我把代码贴上来大家帮忙看看吧。。,好长时间不接触ASP了。。大家帮帮忙,先谢了。
<%
option   explicit
dim   conn,connstr,startime,db,rs,UserAgent
UserAgent   =   Trim(Lcase(Request.Servervariables( "HTTP_USER_AGENT ")))
If   InStr(UserAgent, "teleport ")   >   0   or   InStr(UserAgent, "webzip ")   >   0   or   InStr(UserAgent, "flashget ")> 0   or   InStr(UserAgent, "offline ")> 0   Then
Response.Write   "请不要采用teleport/Webzip/Flashget/Offline等工具来浏览论坛! "
Response.End
End   If

Function   killbad(strChar)
if   strChar= " "   then
killbad= " "
else
killbad=replace(replace(replace(replace(replace(replace(replace(replace(strChar, " ' ", "’ "), "* ", "× "), "? ", "? "), "( ", "( "), ") ", ") "), " < ", "〈 "), ". ", "。 "), "; ", "; ")
end   if
End   Function  
startime=timer()
'db= "admin/##Jsc#$BookShop.bdm "
Set   conn   =   Server.CreateObject( "ADODB.Connection ")
'connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data   Source= "   &   Server.MapPath( " "&db& " ")
connstr= "Provider=SQLOLEDB; "   &   "Server=.; "   &   "Database=1000book; "   &   "UID=sa; "& "pwd=sa; "
conn.Open   connstr

%>

<%
Response.Buffer   =   True
session.timeout=20
%>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<link   href= "css.css "   rel= "stylesheet "   type= "text/css ">



------解决方案--------------------
option explicit是强制声明变量,肯定有未声明的变量。
------解决方案--------------------
connstr= "Provider=SQLOLEDB;Server=.;Database=1000book;UID=sa;pwd=sa; "