ASP代码
- <%
- Set conn = Server.CreateObject("ADODB.Connection")
- Strconn="DRIVER={Microsoft Access Driver (*.mdb)}; "
- Strconn=Strconn & "DBQ=" & Server.MapPath("/database/yanhang.mdb")
- conn.Open Strconn
- %>
MS SQL Server数据库连接
用DSN连接:
ASP代码
- <%
- set conn = Server.CreateObject("ADODB.Connection")
- conn.open "DSN=MyDSN;UID=user;PWD=password;DATABASE=databasename"
- %>
不用DSN连接: