% Dim adoNewsCon 'Database Connection Variable Dim rsNewsConfiguration 'Holds the configuartion recordset Dim strAdoNewsConfig 'Holds the Database driver and the path and name of the database Dim strNewsSQL 'Holds the SQL query for the database Dim intPreviewNewsItems 'Number of files shown on each page Dim blnNewsLCode 'News page code set to true Dim strNewsBgColour 'Holds the background colour of the News Administrator Dim strNewsTextColour 'Holds the text colour of the News Administrator Dim strNewsTextType 'Holds the font type of the News Administrator Dim intNewsTextSize 'Holds the font size of the News Administrator Dim intNewsSmallTextSize 'Holds the size of small fonts Dim strNewsLinkColour 'Holds the link colour of the News Administrator Dim strNewsTableColour 'Holds the table colour Dim strNewsTableBorderColour 'Holds the table border colour Dim strNewsTableTitleColour 'Holds the table title colour Dim strNewsVisitedLinkColour 'Holds the visited link colour of the News Administrator Dim strNewsActiveLinkColour 'Holds the active link colour of the News Administrator 'Create database connection 'Create a connection odject Set adoNewsCon = 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 strAdoNewsConfig = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("weekly/TestNews.mdb") '--------------------------------------------------------------------------------------------------------------------------------------------- 'Set an active connection to the Connection object adoNewsCon.Open strAdoNewsConfig 'Read in the configuration for the script 'Intialise the ADO recordset object Set rsNewsConfiguration = Server.CreateObject("ADODB.Recordset") 'Initialise the SQL variable with an SQL statement to get the configuration details from the database strNewsSQL = "SELECT tblConfiguration.* From tblConfiguration;" 'Query the database rsNewsConfiguration.Open strNewsSQL, strAdoNewsConfig 'If there is config deatils in the recordset then read them in If NOT rsNewsConfiguration.EOF Then 'Read in the configuration details from the recordset strNewsTextColour = rsNewsConfiguration("text_colour") strNewsTextType = rsNewsConfiguration("text_type") intNewsTextSize = CInt(rsNewsConfiguration("text_size")) intNewsSmallTextSize = CInt(rsNewsConfiguration("small_text_size")) strNewsTableColour = rsNewsConfiguration("table_colour") strNewsTableBorderColour = rsNewsConfiguration("table_border_colour") strNewsTableTitleColour = rsNewsConfiguration("table_title_colour") strNewsLinkColour = rsNewsConfiguration("links_colour") strNewsVisitedLinkColour = rsNewsConfiguration("visited_links_colour") strNewsActiveLinkColour = rsNewsConfiguration("active_links_colour") blnNewsLCode = CBool(rsNewsConfiguration("Code")) intPreviewNewsItems = rsNewsConfiguration("No_of_preview_items") End If 'Reset server object rsNewsConfiguration.Close Set rsNewsConfiguration = Nothing %>
|