管理提醒: 本帖被 醉雪枫叶 执行锁定操作(2007-07-10)以前没用过SQL数据库,临时要用,在网上找了很多方法却总有问题。第一页是个表单,把数据提交到第二页中,第二页代码是:
<%
set conn=server.createobject("ADODB.CONNECTION")
connstr="Driver={SQL Server};server=127.0.0.1;database=school.mdf;uid=;pwd=;"
conn.open(connstr)
name=request.Form("loginname")
pwd=request.Form("pwd")
set rsc=server.CreateObject("adodb.recordset")
sqlc="Select * from admin where name='"&name&"' and pwd='"&pwd&"'"
rsc.Open sqlc,conn,1,3
If rsc.bof And rsc.eof Then
response.write("无信息!")
Else
response.write"帐号为:"&rsc("name")
End If
%>
总是显示:Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.
/htm/html/db/a.asp, line 3
这是怎么回事啊?
[ 此贴被醉雪枫叶在2007-07-10 08:37重新编辑 ]