<%@ Language=VBScript %> <% Response.Buffer=True 'Define our ADO constants const adOpenStatic = 3 const adLockOptimistic = 3 '----- Create and Open Connection Set MyConnection = Server.CreateObject("ADODB.Connection") MyConnection.ConnectionString = "PROVIDER=SQLOLEDB;SERVER=YourServerName;UID=YourUID;" & _ "PWD=YourPWD;DATABASE=YourDATABASE" MyConnection.Open '----- Increment Clicked field value SQLBanners = "Select * from Banners Where BannerID=" & Request.QueryString("BannerID") Set Banners = Server.CreateObject("ADODB.Recordset") Banners.CursorType = adOpenStatic Banners.LockType = adLockOptimistic Banners.Open SQLBanners, MyConnection Banners("Clicked") = Banners("Clicked") + 1 Banners.Update Response.Redirect(Request.QueryString("URL")) Response.End '----- Clean up memory Banners.Close MyConnection.Close Set Banners=Nothing Set MyConnection=Nothing %>