|
db.asp
<%
dim conn,strconn
set conn=server.CreateObject("ADODB.Connection")
strconn = "DRIVER=SQL Server;SERVER=(local);UID=sa;PWD=asdfgh;APP=AspRunner Professional Application;WSID=DAISY;DATABASE=myweb"
conn.open strconn
%>
2.asp
<!--#include file="db.asp"-->
<%
dim rs,sql
dim username
set rs=server.CreateObject("adodb.recordset")
sql="select * from user where id=1"
rs.open sql,conn,0,1
username=rs("username")
%>
用户名:<%=username%>
<%
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
打开2。ASP 出现下面错误
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]在关键字 'user' 附近有语法错误。
/2.asp,行7 |
|