<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Execute SQL statement ' Product : CandyPress Store Frontend ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true const adminLevel = 0 %> <% 'Declare variables dim mySQL, cn, rs dim field, count '************************************************************************* 'Are we in demo mode? if demoMode = "Y" then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("DEMO MODE. Sorry, this featured is NOT available in Demo Mode.") end if %>

Execute SQL Command

<% mySql = trim(request.form("mySQL")) if len(mySQL) = 0 then mySql = request.querystring("mySQL") end if %> Query: --> <%=mySQL%>

<% 'Open DB call openDb() 'Open RecordSet set rs = openRSexecute(mySQL) 'Reset Counter count = 1 if rs.State = adStateClosed then Response.Write "
Command Executed." else if rs.eof then Response.Write "
Command Executed." else 'Iterate through RecordSet Response.Write "" do while not rs.eof Response.Write "" for each field in rs.fields Response.Write "" next Response.Write "" if count > 1 then rs.movenext end if count = count + 1 loop Response.Write "
" if count = 1 then response.write "" & field.name & "" else if isNull(rs(field.name)) then response.write "<null> " else response.write rs(field.name) & " " end if end if Response.Write "
" end if 'Close RecordSet call closeRS(rs) end if call closedb() %>