我在网上下了论坛源代码~~
改吧改吧做留言板用的!
不过好像数据库不太稳定,有时还连不上,是因为这个连接的代码有错误吗?
数据库的路径是book/db/bookdb.mdb
<%
Const DBname = "bookdb.mdb"
Const JBBMasterCookies = "bookcookies"
Const BBSHomeUrl="../board.asp?BoardID=1"
startime=timer()*1000
If isObject(Application(JBBMasterCookies & "conn")) = False Then
scriptPath = server.mapPath("db")
if right(lcase(scriptPath),8)="admin\db" then
dbpath=server.mapPath("../db/"&DBname)
else
dbpath=server.mapPath("/book/db/"&DBname)
End if
set conn = Server.CreateObject("ADODB.Connection")
ConnStr = "driver={Microsoft Access Driver (*.mdb)};dbq="&dbpath
conn.open Connstr
if Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库出错!"
Response.End
End If
Application.Lock
Set Application(JBBMasterCookies & "conn") = conn
Application.UnLock
Set conn = Application(JBBMasterCookies & "conn")
Else
Set conn = Application(JBBMasterCookies & "conn")
End If
%>
不知道哪里错了~~~各位大虾帮帮忙啊~~~急啊~~
[此贴子已经被作者于2007-1-4 16:48:46编辑过]