%
function openDB()
on error resume next
set connTemp=server.createobject("adodb.connection")
' alternate database connection strings
' SQL Server local or remote IP in SERVER=
' connString = "Driver={SQL Server};UID=comersus;password=123456;DATABASE=comersus;SERVER=127.0.0.1"
' Jet Oledb connection
' connString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source="&server.mappath("fpdb/storefront.mdb")
' DSN connection, you must define the DSN first in your server
' connString = "DSN=sfData"
connString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("/fpdb/storefront.mdb")&";"
connTemp.Open ConnString
if err.number <> 0 then
response.redirect "comersus_supporterror.asp?error="&Server.Urlencode("Error while opening DB:"&Err.Description& "
Common solutions
1. Check that you haven't change default database path and name
2. Check that your web server has Access 97 or 2000 ODBC installed
3. Check that you have read, modify and delete permissions over database folder and database file
4. Open your database with Access program and select Repair Database option
5. Select other connection method like other connection string or DSN")
end if
end function
function closeDB()
on error resume next
rsTemp.close
connTemp.close
set connTemp = nothing
set rsTemp = nothing
end function
%>