Home » Posts tagged "Classic ASP"

Archive for the 'Classic ASP' Tag

Classic ASP Connection String

Sql connection ************************ Dim connStr connStr = “Provider=SQLOLEDB;Data Source=my-sql-server;UID=MyUsernmame; PWD=MyPassword; database=MyDatabase;” Set objConn = Server.CreateObject(“ADODB.Connection”) objConn.ConnectionTimeOut = 30 objConn.ConnectionString = connStr objConn.Open SET objRS = Server.CreateObject(“ADODB.RecordSet”) objRS.Open “SELECT * FROM my_table ORDER BY type asc”,objConn,1,2 ‘do some sql work objRS.Close SET objRS = Nothing Access 2007/2010 connection ************************ DIM objConn, objRS, dsn, dbPath dsn = […]

Random db record generating script

Generate random db record output. This is classic asp script. VB.NET version is coming soon < % @ Language=”VBScript” %> < % Option Explicit %> < !DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”> <head runat=”server”> <title> <link href=”Styles/Site.css” rel=”stylesheet” type=”text/css” /> </head> <body> <div class=”page”> <div class=”main”> <div style=”width: 900px; text-align: […]

Delete confirm javascript

<a href=”default.asp?do=del&rid=<%= objRS(“ID”) %>” onclick=”return confirm(‘Are you sure you want to delete?’)” >Delete</a>