落伍者站长论坛's Archiver

小宁 发表于 2008-5-5 16:41

asp连接SQL服务器问题,先感谢一下

if not isobject(conn) then
        dim conn
        dim dbpath
        DBPath = Server.MapPath(filedata)
        on error resume next
        set conn=server.createobject("adodb.connection")       
        conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
end if


我想改成连接SQL数据库的代码,麻烦谁告诉我一下,怎么改,谢谢哈

3650798 发表于 2008-5-5 18:27

dim connstr
set Conn = server.CreateObject("ADODB.Connection")
connstr="driver={SQL Server}; server=(local);database=xxxx;uid=xxxxxxxx;pwd=xxxxxxxxxx"
conn.Open connstr

小宁 发表于 2008-5-5 18:50

Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'

[Microsoft][ODBC SQL Server Driver][SQL Server]无法打开登录 'qwertyuiop_Data.MDF' 中请求的数据库。登录失败。

/qwer/conn.asp,行 7


加了还提示这个啊晕

ml1022 发表于 2008-5-9 14:36

数据源

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.