-
Query
Hi,
I have the following code which will allow the user to select the patient_id and a table in the main query.
<%
On Error Resume Next
SET oCmd=server.createobject("adodb.Command"
oCmd.ActiveConnection = "DSN=xxxxxx;UID=xxxxx;PWD=xxxxx;"
strSQLStatement = "select pt_ID from my_patient_table"
'response.write (strSQLStatement) & "<br><br>"
oCmd.CommandText= strSQLStatement
oCmd.CommandType= 1
Set oRs= oCmd.Execute %>
<form name="LimitedQueryForm" action="queryresult1.asp" method="post">
<table border="0" width="100%">
<tr>
<td width="10%"> </td>
<td width="20%"><b>Patient ID:</b></td>
<td width="20%">
<select name="Patient_ID" size="1">
<% Do While Not oRs.EOF
For Each oField in oRs.Fields
If IsNull (oField) Then %>
</td>
<td width="13%"><b>Table Name:</b></td>
<td width="37%"><select name="LTDsqlTable" size="1">
<option value="H">H </option>
<option value="L">L</option>
<option value="A">A</option>
</select> </td>
</tr>
</table>
<form NAME="THEFORM" ACTION="queryresult1.asp?Reset=1" METHOD="POST">
<p align="center"><input type="reset" value="Clear " id="reset1" name="reset1">
<input type="submit" value="Query" id="submit1" name="submit1"> </p>
<a href="queryresult1.asp?id=1"> </a>
And in queryresult1.asp i have
the html form to select the fields from the table and it is linked to queryresult2.asp.
and in queryresult3.asp , i should give the sql statement
MyDb.dbSQL = "SELECT " & Fields & " FROM [tablename] " &"where pt_mpi" = patient_id
Here the patient_id is the one which is selected by the user in the first asp page. My question is how should i export that patient_id to the third asp page in which i should use that for my selection criteria.
Any input is highly appreciated.
Ron
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|