<% ' Details: inlude for database settings %> <% '---- CursorTypeEnum Values ---- Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 Const adOpenDynamic = 2 Const adOpenStatic = 3 '---- LockTypeEnum Values ---- Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 Const adLockBatchOptimistic = 4 Const adUseClient = 3 pDatabaseConnectionString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("db/confectionary.mdb")&";" sub openDb() if varType(connTemp)=0 or varType(connTemp)=1 then ' create the connection set connTemp = server.createObject("adodb.connection") connTemp.Open pDatabaseConnectionString if err.number <> 0 then response.write "Error in Connecting Data Base" end if end if end sub sub getFromDatabase(mySQL, rsTemp) call openDb() set rsTemp = server.createObject("adodb.recordset") ' set locktype rsTemp.lockType = adLockReadOnly ' set the cursor rsTemp.cursorType = adOpenForwardOnly rsTemp.open mySQL, connTemp if err.number <> 0 then response.write "Error in selecting Records" end if end sub sub updateDatabase(mySQL, rsTemp) call openDb() set rsTemp=connTemp.execute(mySQL) if err.number <> 0 then response.write "Error in Record set " end if end sub sub getFromDatabasePerPage(mySQL, rsTemp) call openDb() set rsTemp = server.createObject("adodb.recordset") rsTemp.cursorLocation = adUseClient rsTemp.open mySQL, connTemp if err.number <> 0 then response.write "Error in Record set " end if end sub function closeDB() on error resume next connTemp.close set connTemp = nothing end function function quotesreplace(tempString) quotesreplace= replace(tempString,"'","") end function %> <% ' Details: Get one setting %> <% function getSetting(pSettingKey) dim rstempGetSetting mySQL="SELECT settingValue FROM settings WHERE settingKey='" &pSettingKey& "'" 'response.write mySQL 'response.end on error resume next call getFromDatabase(mySQL, rstempGetSetting) if not rstempGetSetting.eof then getSetting=rstempGetSetting("settingValue") else getSetting="" end if end function %>
Beerntsen's Confectionary
  COMPANY    CONTACT US    SEARCH    HOME     
   FEATURED PRODUCTS

This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text.

This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text.

This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text.

This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text. This is sample text.