Hvorfor Mandag Torsdag Torsdag Søndag Tirsdag Fredag Søndag
Hvorfor udskriver den min kalender i denne rækkefølge: Her er hele koden, som eller virker perfekt:<%Dim MyConn, PER_PAGE, USE_DEBUG, DATE_FORMAT, EXPORT_PATH, arrDAYNAMES(6), arrMONTHNAME(11), USE_WEEKNUM
'// USE THIS VARIABLE TO SET THE DATE FORMAT TO WHATEVER YOUR
'// MS-SQL SERVER EXPECTS, TRY USING THE U.S. DATE FORMAT FIRST (101)
' DATE_FORMAT = 1 '// Date Format: Default 1 YYYYMMDD
' DATE_FORMAT = 2 '// Date Format: ISO YYYY-MM-DD
' DATE_FORMAT = 102 '// Date Format: ANSI yy.mm.dd
' DATE_FORMAT = 103 '// Date Format: British/French dd/mm/yy
' DATE_FORMAT = 104 '// Date Format: German dd.mm.yy
' DATE_FORMAT = 105 '// Date Format: Italian dd-mm-yy
' DATE_FORMAT = 110 '// Date Format: mm-dd-yy
' DATE_FORMAT = 111 '// Date Format: yy/mm/dd
' DATE_FORMAT = 112 '// Date Format: yymmdd
DATE_FORMAT = 105 '// Date Format: USA mm/dd/yy
' SET TO False IF YOU WOULD LIKE TO SEE ANY ERRORS IN IT'S NATURAL STATE
' SET TO True TO USE CUSTOMIZED ERROR MESSAGE (error.asp)
USE_DEBUG = True
' SET TO True IF YOU'D LIKE TO SHOW WEEK NUMBER ON THE CALENDAR
' SET TO False IF THAT IS NOT THE CASE.
USE_WEEKNUM = False
' EVENTS PER PAGE, WHEN LISTING ALL EVENTS AT ONCE
PER_PAGE = 20
' ENTER URL TO THE EXPORT FOLDER; MAKE SURE TO ENTER THE BACKLASH ON THE END
' (This folder is part of the Multi Calendar download, please make sure it has read/write permissions)
EXPORT_PATH = "http://www.YourSite.com/MC2/export/"
' SET YOUR DATABASE CONNECTION
SUB OPEN_DB()
'// MySQL CONNECTION
'Set MyConn = Server.CreateObject("ADODB.Connection")
'MyConn.open = "DRIVER={MySQL ODBC 3.51 Driver};" & "SERVER=mysql.YourDomain.com;" & " DATABASE=dbname;" & "UID=username;PWD=password; OPTION=35"
'// DSN CONNECTION
'Set MyConn = Server.CreateObject("ADODB.Connection")
'MyConn.open = "DSN=calendar"
'// PATH TO DATABASE
dim sti
Set MyConn = Server.CreateObject("ADODB.Connection")
sti = "DB\calendar_version_2.mdb"
MyConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("./" & sti)
'// SAMPLE MapPath CONNECTION
'Set MyConn = Server.CreateObject("ADODB.Connection")
'MyConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\path\db\calendar_version_2.mdb") & ";Persist Security Info=False"
'// MS SQL CONNECTION
'Set MyConn = Server.CreateObject("ADODB.Connection")
'MyConn.Open "Provider=sqloledb;Network Library=DBMSSOCN;Data Source=SQLSERVERADDRESS,1433;Initial Catalog=CATALOG;User ID=USERNAME;Password=PASSWORD;"
END SUB
' *** FOR INTERNATIONAL CUSTOMERS ONLY *** -------------------------------------------------------------------
' [ NO NEED TO CHANGE THIS IF YOU ARE IN US or CANADA]
' NAME DAY NAMES IN YOUR LANGUAGE
' Please note that those names have to refelct your system names.
' For example in US arrDAYNAMES(0) should be Sunday (not SUNDAY, or sunday)
' If your week start on Monday, then arrDAYNAMES(0) should be Monday
' and arrDAYNAMES(1) should be Tuesday
arrDAYNAMES(0) = "Mandag"
arrDAYNAMES(1) = "Tirsdag"
arrDAYNAMES(2) = "Onsdag"
arrDAYNAMES(3) = "Torsdag"
arrDAYNAMES(4) = "Fredag"
arrDAYNAMES(5) = "Lørdag"
arrDAYNAMES(6) = "Søndag"
' [ NO NEED TO CHANGE THIS IF YOU ARE IN US or CANADA]
' NAME MONTH NAMES IN YOUR LANGUAGE
' Please note that those names have to refelct your system names.
' For example in US arrMONTHNAME(0) should be January (not JANUARY, or january)
arrMONTHNAME(0) = "Januar"
arrMONTHNAME(1) = "February"
arrMONTHNAME(2) = "March"
arrMONTHNAME(3) = "April"
arrMONTHNAME(4) = "May"
arrMONTHNAME(5) = "June"
arrMONTHNAME(6) = "July"
arrMONTHNAME(7) = "August"
arrMONTHNAME(8) = "September"
arrMONTHNAME(9) = "October"
arrMONTHNAME(10) = "November"
arrMONTHNAME(11) = "December"
' *** [ FOR INTERNATIONAL CUSTOMERS ONLY ] *** -------------------------------------------------------------------
'// --------------------- NO NEED TO MODIFY ANYTHING BELOW THIS LINE ----------------------\\'
Function FixINJBUG(strWords)
Dim badChars, newChars, i
badChars = array("select", "drop", ";", "--", "insert", "delete", "xp_")
newChars = strWords
for i = 0 to uBound(badChars)
newChars = replace(newChars, badChars(i), "")
next
newChars = Replace(newChars,"'","''")
FixINJBUG = newChars
End Function
PRIVATE FUNCTION CNT_DATE(sDATE)
IF IsDate(sDATE) = True THEN
SELECT CASE DATE_FORMAT
CASE 1 'YYYYMMDD
CNT_DATE = Year(sDATE) & Right(Cstr(Month(sDATE) + 100),2) & Right(Cstr(Day(sDATE) + 100),2)
CASE 2 'YYYY-MM-DD
CNT_DATE = Year(sDATE) & "-" & Right(Cstr(Month(sDATE) + 100),2) & "-" & Right(Cstr(Day(sDATE) + 100),2)
CASE 101 'mm/dd/yy
CNT_DATE = Right(Cstr(Month(sDATE) + 100),2) & "/" & Right(Cstr(Day(sDATE) + 100),2) & "/" & Right(Cstr(Year(sDATE)),2)
CASE 102 'yy.mm.dd
CNT_DATE = Right(Cstr(Year(sDATE)),2) & "." & Right(Cstr(Month(sDATE) + 100),2) & "." & Right(Cstr(Day(sDATE) + 100),2)
CASE 103 'dd/mm/yy
CNT_DATE = Right(Cstr(Day(sDATE) + 100),2) & "/" & Right(Cstr(Month(sDATE) + 100),2) & "/" & Right(Cstr(Year(sDATE)),2)
CASE 104 'dd.mm.yy
CNT_DATE = Right(Cstr(Day(sDATE) + 100),2) & "." & Right(Cstr(Month(sDATE) + 100),2) & "." & Right(Cstr(Year(sDATE)),2)
CASE 105 'dd-mm-yy
CNT_DATE = Right(Cstr(Day(sDATE) + 100),2) & "-" & Right(Cstr(Month(sDATE) + 100),2) & "-" & Right(Cstr(Year(sDATE)),2)
CASE 110 'mm-dd-yy
CNT_DATE = Right(Cstr(Month(sDATE) + 100),2) & "-" & Right(Cstr(Day(sDATE) + 100),2) & "-" & Right(Cstr(Year(sDATE)),2)
CASE 111 'yy/mm/dd
CNT_DATE = Right(Cstr(Year(sDATE)),2) & "/" & Right(Cstr(Month(sDATE) + 100),2) & "/" & Right(Cstr(Day(sDATE) + 100),2)
CASE 112 'yymmdd
CNT_DATE = Right(Cstr(Year(sDATE)),2) & Right(Cstr(Month(sDATE) + 100),2) & Right(Cstr(Day(sDATE) + 100),2)
END SELECT
ELSE
CNT_DATE = Null
END IF
END FUNCTION
PRIVATE FUNCTION GET_WEEK_NUMBER(sDate)
GET_WEEK_NUMBER = DatePart("ww", sDate, 2, vbFirstFourDays)
END FUNCTION
%>
