<%
Dim connstr
db="eduask.mdb"
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/") &"\\"& db
' On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "Sorry! 数据库连接出错,请检查连接字串。"
Response.End
End If
%>
<%function checkStr(str)
if isnull(str) then
checkStr = ""
exit function
end if
checkStr=replace(str,"'","''")
end function%>
<%
sql="select top 10 * from content where sort='学员作品'"
set rs=conn.execute(sql)
for i=1 to 10
%>