<% Dim adoCon 'Database Connection Variable Dim strAccessDB 'Holds the Access Database Name Dim rsConfiguration 'Holds the configuartion recordset Dim strCon 'Holds the Database driver and the path and name of the database Dim strSQL 'Holds the SQL query for the database Dim strWebsiteName 'Holds the website name Dim strWebsiteAddress 'Holds the website URL and path to the script Dim strWebsiteEmailAddress 'Holds the forum e-mail address Dim strTestEmailAddress 'holds the e-mail address the preview e-mail is sent to Dim strMailComponent 'Email coponent the mailing list useses Dim strMailServer 'Websites incomming mail server (for JMail) Dim strBgColour 'Holds the background colour of the Mailing List Dim blnLCode 'set to true Dim strCode 'Holds the page code Dim strCodeField 'Holds the code type Dim strTextColour 'Holds the text colour of the Mailing List Dim strTextType 'Holds the font type of the Mailing List Dim intTextSize 'Holds the font size of the Mailing List Dim strLinkColour 'Holds the link colour of the Mailing List Dim strVisitedLinkColour 'Holds the visited link colour of the Mailing List Dim strHoverLinkColour 'Holds the mouse over link colour of the Mailing List Dim strWelcomeMessage 'Holds the welcome message that is sent to users Dim strWelcomeFormat 'Holds the welcome message format 'Create database connection 'Initialise the strAccessDB variable with the name and the path to the Access Database strAccessDB = "mailing_list.mdb" 'Create a connection odject Set adoCon = Server.CreateObject("ADODB.Connection") '------------- If you are having problems with the script then try using a diffrent driver or DSN by editing the lines below -------------- 'Database connection info and driver (if this driver does not work then comment it out and use one of the alternative drivers) strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(strAccessDB) 'Alternative drivers 'strCon = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & Server.MapPath(strAccessDB) 'This one is for Access 97 'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(strAccessDB) 'This one is for Access 2000 'If you wish to use DSN then comment out the driver above and uncomment the line below (DSN is slower than the above drivers) 'strCon = "DSN=guestbook" 'Place the DSN name after the DSN= '--------------------------------------------------------------------------------------------------------------------------------------------- 'Set an active connection to the Connection object adoCon.Open strCon 'Set up the page encoding strCodeField = "Code" strCode = "nolinks2002" 'Read in the mailing list configuration 'Intialise the ADO recordset object Set rsConfiguration = Server.CreateObject("ADODB.Recordset") 'Initialise the SQL variable with an SQL statement to get the configuration details from the database strSQL = "SELECT tblConfiguration.* From tblConfiguration;" 'Query the database rsConfiguration.Open strSQL, strCon 'If there is config deatils in the recordset then read them in If NOT rsConfiguration.EOF Then 'Read in the configuration details from the recordset strWebsiteName = rsConfiguration("website_name") strWebsiteAddress = rsConfiguration("website_address") strWebsiteEmailAddress = rsConfiguration("website_email_address") strTestEmailAddress = rsConfiguration("test_email_address") strMailComponent = rsConfiguration("mail_component") strMailServer = rsConfiguration("mail_server") strBgColour = rsConfiguration("bg_colour") strTextColour = rsConfiguration("text_colour") strTextType = rsConfiguration("text_type") intTextSize = CInt(rsConfiguration("text_size")) strLinkColour = rsConfiguration("links_colour") strVisitedLinkColour = rsConfiguration("visited_links_colour") strHoverLinkColour = rsConfiguration("active_links_colour") strWelcomeMessage = rsConfiguration("welcome_message") strWelcomeFormat = rsConfiguration("welcome_format") blnLCode = CBool(rsConfiguration("Code")) End If 'Reset server object rsConfiguration.Close Set rsConfiguration = Nothing '*********************************************** 'Function to strip non alphanumeric characters for links and email addresses Private Function characterStrip(strTextInput) 'Dimension variable Dim intLoopCounter 'Holds the loop counter 'Loop through the ASCII characters For intLoopCounter = 0 to 37 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Loop through the ASCII characters For intLoopCounter = 39 to 44 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Loop through the ASCII characters numeric characters to lower-case characters For intLoopCounter = 65 to 94 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Loop through the extended ASCII characters For intLoopCounter = 123 to 125 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Loop through the extended ASCII characters For intLoopCounter = 127 to 255 strTextInput = Replace(strTextInput, CHR(intLoopCounter), "", 1, -1, 0) Next 'Strip individul ASCII characters left out from above left over strTextInput = Replace(strTextInput, CHR(59), "", 1, -1, 0) strTextInput = Replace(strTextInput, CHR(60), "", 1, -1, 0) strTextInput = Replace(strTextInput, CHR(62), "", 1, -1, 0) strTextInput = Replace(strTextInput, CHR(96), "", 1, -1, 0) 'Return the string characterStrip = strTextInput End Function '******************************************************* %>