Microsoft OLE DB Provider for SQL Server 错误 '80040e14' '#' 附近有语法错误。 /inc/conn.asp,行 26 conn.asp页面代码如下:<!--#include file="md5.asp"-->
<%
'定义全局变量
Dim conn,rs,dbfile'错误处理
'on error resume next'打开数据库连接
Function opendb(querystr,rsmode)strSQLServerName = "localhost" 'server
strSQLDBUserName = "sa" 'username
strSQLDBPassword = "" 'password
strSQLDBName = "guahao" 'Database name connstr = "Provider=SQLOLEDB.1;Persist Security Info=False;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"
set conn = Server.CreateObject("ADODB.CONNECTION")
conn.open connstr
If not querystr = "" then
set rs = Server.CreateObject("ADODB.Recordset")
Select case rsmode
case "1" rs.open querystr,conn,1,1
case "2" rs.open querystr,conn,2,2
case "3" rs.open querystr,conn,1,3
case else rs.open querystr,conn,1,1
End Select
End If
End Function'关闭数据库连接
Function closedb()
if vartype(rs)=0 then
rs.close
set rs=nothing
end if
conn.close
set conn=nothing
End Function'消息控制函数
sub mymsgbox(msgstring)
msgstring=cstr(msgstring)
response.write "<script language=""JavaScript"">alert ('"&msgstring&"');</script>"
end subsub mybackmsgbox(msgstring)
msgstring=cstr(msgstring)
response.write "<script language=""JavaScript"">alert ('"&msgstring&"');history.back();</script>"
end subsub mygoto(urlstring)
urlstring=cstr(urlstring)
response.write "<script language=""JavaScript"">window.location = '"&urlstring&"';</script>"
end sub
%>
<%
'定义全局变量
Dim conn,rs,dbfile'错误处理
'on error resume next'打开数据库连接
Function opendb(querystr,rsmode)strSQLServerName = "localhost" 'server
strSQLDBUserName = "sa" 'username
strSQLDBPassword = "" 'password
strSQLDBName = "guahao" 'Database name connstr = "Provider=SQLOLEDB.1;Persist Security Info=False;Server=" & strSQLServerName & ";User ID=" & strSQLDBUserName & ";Password=" & strSQLDBPassword & ";Database=" & strSQLDBName & ";"
set conn = Server.CreateObject("ADODB.CONNECTION")
conn.open connstr
If not querystr = "" then
set rs = Server.CreateObject("ADODB.Recordset")
Select case rsmode
case "1" rs.open querystr,conn,1,1
case "2" rs.open querystr,conn,2,2
case "3" rs.open querystr,conn,1,3
case else rs.open querystr,conn,1,1
End Select
End If
End Function'关闭数据库连接
Function closedb()
if vartype(rs)=0 then
rs.close
set rs=nothing
end if
conn.close
set conn=nothing
End Function'消息控制函数
sub mymsgbox(msgstring)
msgstring=cstr(msgstring)
response.write "<script language=""JavaScript"">alert ('"&msgstring&"');</script>"
end subsub mybackmsgbox(msgstring)
msgstring=cstr(msgstring)
response.write "<script language=""JavaScript"">alert ('"&msgstring&"');history.back();</script>"
end subsub mygoto(urlstring)
urlstring=cstr(urlstring)
response.write "<script language=""JavaScript"">window.location = '"&urlstring&"';</script>"
end sub
%>
<!--#include file="md5.asp"-->
然后运行看看,然后再吧那个引用文件去掉,只保留那些函数和过程运行一下看看。