Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameterized Query using SQL and DTC Recordset?

Status
Not open for further replies.

tmishue

Programmer
Jun 26, 2001
35
US
Where should I start?

I need help in passing a parameter to my DTC Recordset to query my SQL database and display my records in a DTC Grid. My target platform is the the Server using VBScript as the language. My client script is using javascript as the language.

I am using the Active X Calendar Control as my starting point. When the user clicks on the desired date I am passing the Calendar.value to a variable. At this point the value in the variable needs to set the parameter for the DTC Recordset. Then the DTC Recordset should be opened based on that variable to display the records in my database that occur on that date.

Everything that I have see has said to bind the Recordset to a variable or value and then open it. Here's some of what I have done but when I click on the Button (btnview) it goes to a blank page. clHoldate is the variable that the Recordset is bound to. Can someone please help to turn me in the right direction?
Code:
<SCRIPT ID=serverEventHandlersVBS LANGUAGE=vbscript RUNAT=Server>
Dim clHoldate
Function btnview_onclick()
Recordset1.close()
clHoldate = textbx.value
Recordset1.open()
End Function
</SCRIPT>
</HEAD>

<BODY bgColor=white>
<%
textbx.value = date
%>

<SCRIPT LANGUAGE=javascript FOR=CalCtrl EVENT=Click>
<!--
textbx.value = (CalCtrl.Value)
CalCtrl_Click(textbx)
//-->
</SCRIPT>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript RUNAT=&quot;Server&quot;>
<!--
var clHoldate
function CalCtrl_Click(textbx) {
clHoldate = textbx.value
}
//-->
</SCRIPT>
 
Just for closure the problem was resolved doing a setSQLText to (my new query) in the openbeforeopen event of the DTC Recordset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top