Forum Moderators: open
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/shop/includes/config.asp, line 89
MS Access OLEDB Connection String
---------^
HERE IS THE ENTIRE CODE:
<%
'===============================================
' CactuShop ASP Shopping Cart
' ©1999-2004 Cactusoft Ltd. www.cactusoft.com
'===============================================
' All rights reserved.
' Use of this code is covered by the terms and
' conditions in the license agreement. No
' unauthorized duplication or distribution is
' permitted. Cactusoft's copyright notices must
' remain in the ASP sections of the code.
'===============================================
'-----------------------------------------------
'CACTUSHOP LICENSE NUMBER
'The license number given to you when you
'received your copy of CactuShop must be entered
'below, within the double quotes:
CONST LICENSENUMBER = "CactuShop Lite v5"
'This is a license requirement - to run
'CactuShop without the valid license number, or
'to run more than one copy of CactuShop with the
'same license number is a copyright violation
'and a breach of the software license.
'-----------------------------------------------
'-----------------------------------------------
'CACTUSHOP v5 CONFIG FILE
'The database connection must be properly
'configured below, but most other stuff can then
'be set conveniently online from the CactuShop
'back end.
'-----------------------------------------------
session.LCID = 1033 'local identifier - CactuShop is designed to run on US defaults, leave this setting intact
'-----------------------------------------------
'VERSION INFORMATION
'This is current primarily used for support and
'language string version information.
'Changing this won't necessarily kill your shop,
'but it will for ever more make (language table)
'upgrades difficult and links to the
'knowledgebase may not work correctly.
CONST CACTUSHOPVERSION = 5.104
'-----------------------------------------------
'-----------------------------------------------
'DEVELOPER LICENSE
'If you are a developer you can include your own
'license or copyright notice at the top of all
'the pages (it will appear underneath the
'cactushop license) by editing this setting
CONST DEVELOPERLICENSE = ""
'-----------------------------------------------
'-----------------------------------------------
'DATABASE CONNECTION SETTINGS
'Uncomment (remove the ' at the start of the
'line) the database type you are using, and
'comment up the other two.
'Depending on which database you are using,
'uncomment the connection string and enter in
'the connection details. See the Quick Setup
'Guide and the manual for more information
'-----------------------------------------------
'Database type - access, sql or mysql
'CONST strDatabaseType = "mysql"
'CONST strDatabaseType = "mssql"
CONST strDatabaseType = "access"
'Cursor type for executing queries - change to 1 for SQL Server if the site misbehaves after upsizing
numCursorType = 3
'MySQL ODBC Connection String
'CONST strDataSourceName = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=#*$!.xxx.xxx.xxx;DATABASE=mydatabasename;USER=username;PASSWORD=password;OPTION=3;"
'CONST strDataSourceName = "DRIVER={MySQL};SERVER=xxx.xxx.xxx.xxx;DATABASE=cactushop5;USER=username;PASSWORD=password;OPTION=3;"
'CONST strDataSourceName = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=xxx.xxx.xxx.xxx;DATABASE=mydatabasename;USER=root;OPTION=3;"
'MS SQLServer Connection String (for connecting on port 1433 - the standard port for SQL Server)
'CONST strDataSourceName="Provider=sqloledb;Data Source=xxx.xxx.xxx.xxx,1433;Network Library=DBMSSOCN;Initial Catalog=mydatabasename;User ID=userid;Password=password;"
'CONST strDataSourceName="Provider=sqloledb;Data Source=xxx.xxx.xxx.xxx,1433;Network Library=DBMSSOCN;Initial Catalog=mydatabasename;Trusted_Connection=yes;"
'MSDE Connection String
'CONST strDataSourceName = "Provider=SQLOLEDB.1;Initial Catalog=mydatabasename;Data Source=xxx.xxx.xxx.xxx,1433;User ID=userid;Password=password;"
MS Access OLEDB Connection String
strPathToDatabase = "shop/database/cactushop5.mdb" 'WE ADVISE TO CHANGE THIS OR TURN OFF READ ACCESS TO THIS FOLDER
'strDatabasePassword = "hello"
strDataSourceName = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(strPathToDatabase) & ";Jet OLEDB:Database Password=" & strDatabasePassword
'-----------------------------------------------
'-----------------------------------------------
'CREATE DATABASE CONNECTION
'-----------------------------------------------
Set objDataConn = Server.CreateObject("ADODB.Connection")
objDataConn.Open strDataSourceName
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set objRecordSet = Server.CreateObject("ADODB.Recordset")
Set objRecordSet2 = Server.CreateObject("ADODB.Recordset")
'-----------------------------------------------
'-----------------------------------------------
'SET UP MISCELLANEOUS ARRAYS, VARIABLES, ETC.
'-----------------------------------------------
Dim aryCurrencies(6) 'Create array for use later in page when dynamically converting currencies
Dim aryCurrenciesGateway(6) 'Create array for use later in page when dynamically converting currencies
Dim strCategoryListHTML
'-----------------------------------------------
'-----------------------------------------------
'CHECK FOR AND CREATE APPLICATION VARIABLES
'This resetting can be forced by passing 'reset'
'as a querystring called 'appvar'. The config
'list file in the back end does this to allow
'you to force changes to the config settings to
'take effect.
'IE seems to have a bug that it sometimes
'returns the value with the hash anchor. So we
'check for one and split around it.
'-----------------------------------------------
appvar = request.QueryString("appvar")
If Ucase(left(appvar, 1)) <> "R" AND appvar<>"" then
Call ExecuteSQL(appvar, numCursorType, objRecordSet)
End if
if instr(appvar,"#") > 0 Then
aryAppVar = split(appvar,"#")
appvar = aryAppVar(0)
End If
'Rebuild the variables if either:
'- the appvar querystring tells us to
'- The languageid isn't found (a common problem when using the upgrader)
'- The lastupdated config setting is blank
'- The lastupdated is different to the one in the DB (only for multiserver)
blnRebuild = (Application(LICENSENUMBER & "lastupdated") = "") OR (Application(LICENSENUMBER & "defaultlanguageid") & "" = "") OR (appvar="reset")
if not blnRebuild then
'Check if lastupdated config setting matches lastupdated record in DB
strQuery = "SELECT CFG_Value FROM tblCactuShopConfig WHERE CFG_Name = 'lastupdated'"
blnRebuild = NOT (objDataConn.Execute(strQuery)("CFG_Value") = Application(LICENSENUMBER & "lastupdated"))
End If
'Lets rebuild if we need to
If blnRebuild then
'Update the lastupdated date with the datetime
strQuery = "UPDATE tblCactuShopConfig SET CFG_Value = '" & ReverseFormatYear(now) & "' WHERE CFG_Name = 'lastupdated'"
objDataConn.Execute(strQuery)
'Rebuild all the config settings
strQuery = "SELECT CFG_Name, CFG_Value, CFG_DataType FROM tblCactuShopConfig"
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
Do while NOT objRecordSet.EOF
If objRecordSet("CFG_DataType") = "n" then
CFG_Value = objRecordSet("CFG_Value") * 1
Else
CFG_Value = objRecordSet("CFG_Value")
End if
Application(LICENSENUMBER & objRecordSet("CFG_Name")) = CFG_Value
objRecordSet.MoveNext
loop
objRecordSet.Close
End if
'-----------------------------------------------
'-----------------------------------------------
'COOKIE CHECK
'Only runs if config setting says so. It checks
'to see if we're on the failure page (if we are
'then ignore check, natch.). If cookie check is
'done and it was failed (passed in querystring),
'redirect to failure page. Otherwise check
'cookie exists. If not, redirect (with page URL)
'to set it.
'-----------------------------------------------
If Application(LICENSENUMBER & "cookiecheck") = "y" then
'Get the current page details
strScriptName = request.ServerVariables("PATH_INFO")
strQueryString = request.ServerVariables("QUERY_STRING")
'just get the name of the page from the script name
intLastSlash = instrrev(strScriptName, "/")
if intLastSlash > 0 then strScriptName = mid(strScriptName, intLastSlash + 1)
'Only proceed if it's not the check or fail page
If not (strScriptName = "cookies_failed.asp") and not (strScriptName = "cookies_check.asp") then
'Check to see if we've got the cookie
If not request.cookies(Application(LICENSENUMBER & "cookiename"))("cookiecheck") = "yes" then
'If we've already tried planting it, then it must have failed
If request.QueryString("cookiecheck") = "yes" then
response.Redirect("cookies_failed.asp")
else
'Go off and plant the cookie
response.Redirect("cookies_check.asp?page=" & server.URLEncode(strScriptName) & "&qs=" & Replace(strQueryString, "&", "amp;"))
end if
end if
end if
end if
'-----------------------------------------------
'-----------------------------------------------
'ENCRYPTION KEY
'If you are using our encryption add-on your key
'goes here
'-----------------------------------------------
CONST ENCRYPTIONKEY = "1212121212121212xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
'-----------------------------------------------
'-----------------------------------------------
'GET THE CURRENCY CHOICE
'If a currency is in the querystring, then store
'that. Otherwise check the cookie. Failing that,
'use the first value. If it's the back end, use
'the default currency.
'-----------------------------------------------
If InStr(request.ServerVariables("PATH_INFO"), "/_") then
numCurrencyID = 1
else
numCurrencyID = Request.QueryString("numCurrencyID")
If numCurrencyID = "" then
numCurrencyID = request.cookies(Application(LICENSENUMBER & "cookiename"))("numCurrencyID")
End if
If numCurrencyID = "" then
numCurrencyID = request.form("numCurrencyID")
End if
If numCurrencyID = "" or Not Isnumeric(numCurrencyID) then
numCurrencyID = 1
End if
response.cookies(Application(LICENSENUMBER & "cookiename"))("numCurrencyID") = numCurrencyID
end if
'-----------------------------------------------
'-----------------------------------------------
'GET THE LANGUAGE CHOICE
'If a language is in the querystring, then store
'that. Otherwise check the cookie. Failing that,
'use the default. If it's the backend, use the
'login language, or failing that the config setting
'-----------------------------------------------
If InStr(request.ServerVariables("PATH_INFO"), "/_") Then
'In backend, grab it from cookie
numLanguageID = request.cookies(Application(LICENSENUMBER & "cookiename") & " security")("LOGIN_Language") & ""
If numLanguageID = "" then numLanguageID = Application(LICENSENUMBER & "defaultlanguageid")
blnBackEnd = True
Else
'Set the language ID
numLanguageID = Request.QueryString("numLanguageID")
If numLanguageID = "" then numLanguageID = request.cookies(Application(LICENSENUMBER & "cookiename") & "lang")("numLanguageID")
If numLanguageID = "" then numLanguageID = request.form("numLanguageID")
If numLanguageID = "" or Not Isnumeric(numLanguageID) then numLanguageID = Application(LICENSENUMBER & "defaultlanguageid")
'Store it in cookies
response.cookies(Application(LICENSENUMBER & "cookiename") & "lang")("numLanguageID") = numLanguageID & ""
response.cookies(Application(LICENSENUMBER & "cookiename") & "lang").Expires = now + 365
End If
strQuery = "SELECT LANG_SkinLocation, LANG_EmailTo, LANG_EmailToContact, LANG_EmailFrom FROM tblCactuShopLanguages WHERE LANG_ID = " & numLanguageID
Call ExecuteSQL(strQuery, numCursorType, objRecordSet)
If Not (objRecordSet.BOF And objRecordSet.EOF) Then
strLanguageSkinLocation = objRecordSet("LANG_SkinLocation")
'Get the language-specific email settings
strEmailTo = objRecordSet("LANG_EmailTo")
strEmailToContact = objRecordSet("LANG_EmailToContact")
strEmailFrom = objRecordSet("LANG_EmailFrom")
Else
numLanguageID = 1
End If
objRecordSet.Close
strLanguageTableName = "tblCactuShopLanguageStrings" & Cstr(numLanguageID)
'-----------------------------------------------
'-----------------------------------------------
'LOAD UP THE PAGE STRINGS
'-----------------------------------------------
Dim StringDict
Set StringDict = Server.CreateObject("Scripting.Dictionary")
'-----------------------------------------------
'-----------------------------------------------
'BASE STRINGS
'Base page strings for functions.asp, backend
'menu etc.
'-----------------------------------------------
BaseStrings = "18, 242, 243, 244, 255, 256, 257, 258, 259, 260, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 300, 308, 603, 683, 704, 833, 834, 863, 883, 886, 887, 888, 902, 1130, 1201"
TotalStrings = BaseStrings
If Not PageStrings = "" Then TotalStrings = TotalStrings & "," & PageStrings
'-----------------------------------------------
'-----------------------------------------------
'BACK END BASE STRINGS
'-----------------------------------------------
If blnBackEnd = True Then
TotalStrings = BaseStrings & ", " & "592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 663, 715, 800, 872, 873, 874, 900, 903, 904, 907, 960, 988, 990, 1004, 1008, 1009, 1066, 1070, 1071, 1072, 1076"
End If
If Not PageStrings = "" Then TotalStrings = TotalStrings & ", " & PageStrings
Call LoadStrings(TotalStrings, strLanguageTableName)
'-----------------------------------------------
'-----------------------------------------------
'SET DEFAULT PAGETITLE (SOME PAGES OVERRULE IT!)
'-----------------------------------------------
strPageTitleHTML = GetString("Config_Webshopname")
%>
THANK YOU VERY MUCH