ASP连接Access数据库的方法如下:
1. 在ASP页面中创建一个连接对象:
```
Set conn = Server.CreateObject("ADODB.Connection")
```
2. 设置连接字符串:
```
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\mydatabase.mdb"
```
3. 打开数据库连接:
```
conn.Open
```
4. 执行SQL语句:
```
Set rs = conn.Execute("SELECT * FROM mytable")
```
5. 关闭数据库连接:
```
rs.Close
conn.Close
```
完整示例代码:
```
<%
Dim conn, rs
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\mydatabase.mdb"
conn.Open
Set rs = conn.Execute("SELECT * FROM mytable")
While Not rs.EOF
Response.Write rs("field1") & " " & rs("field2") & "
"
rs.MoveNext
Wend
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
%>
```