%@ 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") %>
|
| <% WriteString("PageTitle_ExecuteQuery") %> |
<% if strError = "" then %>
| <% WriteString("ContentText_QuerySuccess") %> |
| <% WriteString("ContentText_RecordsAffected") %> <%= numRecordsAffected %> |
<% If objRS.State = 0 then %>
| No records returned. |
<% else %>
| 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 %>
| <%= objField.Name %> |
<% Next %>
<% End If
'SHOW ROW %>
<% For i = 0 to intFieldCount - 1
objValue = objRS(i)
If isnull(objValue) or objValue = "" then objValue = " " %>
| <%= objValue %> |
<% next %>
<% objRS.MoveNext
loop %>
|
<% end if %>
<% else %>
| <% WriteString("ContentText_QueryFailed") %> |
<%= strError %>
|
<% end if %>
| <% WriteString("ContentText_QueryExecuted") %> |
<%= strUserQuery %> |
| |
|