Skip to content

Instantly share code, notes, and snippets.

View evagoras's full-sized avatar

Evagoras Charalambous evagoras

View GitHub Profile
@evagoras
evagoras / before-2021
Created September 28, 2023 16:12
Clarifying the use of the DateFormat ‘D’ mask for ACF2021+
<cfscript>
writeOutput( dateFormat( createDate( "2023", "01", "01" ), "YYYY-MM-DD" ) );
</cfscript>
@evagoras
evagoras / .wsh
Last active September 28, 2023 15:33
The Windows 2000 Indexing Service
[ScriptFile]
Path=C:\ServerScripts\SendEmailOnServiceFail.vbs
[Options]
Timeout=20
DisplayLogo=1
@evagoras
evagoras / class
Created September 28, 2023 15:25
A Generic GetRows VBScript Class
Class Database
Dim i_dbConnection
Dim i_objConn
Dim i_objRS
Private Sub Class_Initialize()
Const MAX_TRIES = 10
Dim intTries
On Error Resume Next
@evagoras
evagoras / checkbox
Last active September 28, 2023 15:05
Web-based Content Editor using IFrame
<input type="checkbox" onclick="setMode(this.checked)">
@evagoras
evagoras / new-mail
Created September 28, 2023 14:22
Formatting complex ASP output using HTML templates
...
Set objEmail = Server.CreateObject("CDONTS.NewMail")
objEmail.BodyFormat = 0 'CdoBodyFormatHTML objEmail.MailFormat = 0 'CdoMailFormatMime
objEmail.From = strEmail
objEmail.To = "someone@somewhere.com"
objEmail.Subject = strSubject
objEmail.Body = ReadFile("template.htm")
objEmail.Send
Set objEmail = Nothing
@evagoras
evagoras / add-output
Last active September 28, 2023 14:13
A Generic GetRows VBScript Class – Part II: Adding Update and AddNew functions
<%
Dim arrFields
Dim arrValues
Dim clsDatabase
Dim numNewID
Dim numCategoryID,strQuestion,strAnswer,numPosterID
numCategoryID = "5"
strQuestion = "What is this?"
strAnswer = "This is the answer."
numPosterID = "10"
@evagoras
evagoras / asp-multipleparamquery
Created September 28, 2023 14:06
Calling MS Access Parameterized Queries from ASP
...
strQuery = "faq_qry_sub_categories '" & numCategoryID & "', '" & secondparam & "'"
...
@evagoras
evagoras / download.asp
Created September 28, 2023 14:03
Downloading any file using ASP, FSO and the ADODB Stream object
<%@Language="VBScript"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<%
On Error Resume Next
Dim strPath
strPath = CStr(Request.QueryString("file"))
'-- do some basic error checking for the QueryString
If strPath = "" Then
Response.Clear
@evagoras
evagoras / call-download
Created September 28, 2023 14:01
Downloading any file to the browser – Part II: using ASP.NET
<a href="download.aspx?file=/images/logo.gif">Download the logo image</a>
@evagoras
evagoras / create-variables
Created September 28, 2023 13:55
Generating an XML file of your website’s folders/files
<%@Language="VBScript"%>
<%Option Explicit%>
<%Response.Buffer = True%>
<%
'-- set a 600 second timeout value in case it hangs
Server.ScriptTimeOut = 600
On Error Resume Next
Dim strRootFolder
Dim intLenRootFolder