<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "1239, 1242, 1243, 1244, 1245" strThisBackPage = "config" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== 'Get the query strUserQuery = request.Form("sql") if trim(strUserQuery) = "" then response.Redirect("_executequery.asp") 'An execute it, getting the records effected Dim numRecordsAffected numRecordsAffected = 1234 'Set up the query If strDatabaseType = "mysql" Then objDataConn.CursorLocation = 3 Else objDataConn.CursorLocation = numCursorType End If 'Set objField = Server.CreateObject("ADODB.Field") 'Execute 'if not (blnDoingTransaction or blnDoingCallback) then On Error Resume Next 'Set objRS = Server.CreateObject("ADODB.RecordSet") Set objRS = objDataConn.Execute(strUserQuery, numRecordsAffected) 'Error trapping if err.Description <> "" and not blnDoingTransaction then strError = err.Description end if 'Stop error trapping 'if not (blnDoingTransaction or blnDoingCallback) then on error goto 0 %> <% =GetString("Config_headtitle") %>
<% if strError = "" then %> <% If objRS.State = 0 then %> <% else %> <% end if %> <% else %> <% end if %>
<% WriteString("PageTitle_ExecuteQuery") %>
<% WriteString("ContentText_QuerySuccess") %>
<% WriteString("ContentText_RecordsAffected") %> <%= numRecordsAffected %>
No records returned.
Returns returned:
<% intRecCount = 0 intFieldCount = 0 %> <% do while not objRS.EOF intRecCount = intRecCount + 1 'DO TABLE HEADINGS If intRecCount = 1 then %> <% 'Write out the headers For Each objField In objRS.Fields intFieldCount = intFieldCount + 1 %> <% Next %> <% End If 'SHOW ROW %> <% For i = 0 to intFieldCount - 1 objValue = objRS(i) If isnull(objValue) or objValue = "" then objValue = " " %> <% next %> <% objRS.MoveNext loop %>
<%= objField.Name %>
<%= objValue %>
<% WriteString("ContentText_QueryFailed") %>
<%= strError %>

<% WriteString("ContentText_QueryExecuted") %>
<%= strUserQuery %>