Code Samples
6 samples across all languages, sorted by popularity
<%@ Language="VBScript" %> <% Option Explicit Dim conn, rs, strSQL ...
Database Access with ADO ADO (ActiveX Data Objects) provides a high-level interface for accessing data from ASP pages. This code sample demonstrates…
COM Automation with VBScript
VBScript
' FileSystemObject — file and folder operations
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
' Check if a file exists
If fso.FileExists("C:\logs\app.log") Then
...
COM Automation with VBScript VBScript can automate any COM object that supports IDispatch (Automation). This sample demonstrates common automation scenarios. File System…
ADO Connection Strings
VBScript
' SQL Server connection using SQLOLEDB provider
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
' Windows Authentication (trusted connection)
conn.Open "Provider=SQLOLEDB;" & _
...
ADO Connection Strings ActiveX Data Objects (ADO) is the standard data access library for classic ASP and VBScript. This reference covers connection…
<%@ Language="VBScript" %> <% Option Explicit Dim strUsername, strEmail, strPassword, strConfirm Dim arrErrors() ...
Server-Side Form Validation Always validate form input on the server, even if you also validate with JavaScript on the client. This code…
Mailbox Access via HTTP/WebDAV
VBScript
' Exchange WebDAV Inbox Reader ' Retrieves the 10 most recent messages from a user's inbox Dim strServer, strUser, strPassword, strMailbox strServer = "mail.corp.flamenet.io" strUser = "CORP\jsmith" ...
Mailbox Access via HTTP/WebDAV This VBScript sample demonstrates how to read inbox messages from Exchange 2000 using the WebDAV SEARCH method and…
Automating SharePoint with VBScript
VBScript
' Retrieve all lists from a SharePoint site via SOAP
Dim strURL, strSOAP
strURL = "http://sharepoint.corp.flamenet.io/_vti_bin/Lists.asmx"
strSOAP = "<?xml version=""1.0"" encoding=""utf-8""?>" & vbCrLf & _
"<soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & vbCrLf & _
...
Automating SharePoint with VBScript You can automate SharePoint Team Services from VBScript using the SOAP web services and the XMLHTTP COM object.…