Forums
This topic is locked
SQL window?
Posted 19 Nov 2001 23:05:16
1
has voted
19 Nov 2001 23:05:16 steven levy posted:
I need some code to display the results of any adhock query.Also a window to allow the execution of any insert, update, create etc
Steven Levy,
Replies
Replied 20 Nov 2001 18:08:05
20 Nov 2001 18:08:05 Owen Eastwick replied:
Create a form on one page with a text box in which to enter your SQL Query along with a submit button.
Then create a results page with code something like:
<%
strSQL = Request(txtYourTextBoxName)
%>
<%
If strSQL <> "" Then
set rsYourRecordsetName = Server.CreateObject("ADODB.Recordset" '
rsYourRecordsetName.ActiveConnection = MM_YourDSNname_STRING
rsYourRecordsetName.Source = strSQL
rsYourRecordsetName.CursorType = 0
rsYourRecordsetName.CursorLocation = 2
rsYourRecordsetName.LockType = 3
rsYourRecordsetName.Open()
rsYourRecordsetName_numRows = 0
End If
%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Then create a results page with code something like:
<%
strSQL = Request(txtYourTextBoxName)
%>
<%
If strSQL <> "" Then
set rsYourRecordsetName = Server.CreateObject("ADODB.Recordset" '
rsYourRecordsetName.ActiveConnection = MM_YourDSNname_STRING
rsYourRecordsetName.Source = strSQL
rsYourRecordsetName.CursorType = 0
rsYourRecordsetName.CursorLocation = 2
rsYourRecordsetName.LockType = 3
rsYourRecordsetName.Open()
rsYourRecordsetName_numRows = 0
End If
%>
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo