Skip to main content
Participant
February 3, 2009
Answered

Reuse parameters in variables

  • February 3, 2009
  • 1 reply
  • 435 views
Hi, please can someone help me with this as I have been searching the forums for over an hour.

There is some indication that the code Dreamweaver creates does not allow more than one recordset to use the same variable parameter, ie a URL parameter in both recordset queries.

Can someone please help with how I can manually adjust the code so that it works?

This is what I have so far for one recordset, which bit do I change?

quote:


<%
Dim RSsepcsubdetail
Dim RSsepcsubdetail_cmd
Dim RSsepcsubdetail_numRows

Set RSsepcsubdetail_cmd = Server.CreateObject ("ADODB.Command")
RSsepcsubdetail_cmd.ActiveConnection = MM_conn_vb_pureinfo_STRING
RSsepcsubdetail_cmd.CommandText = "SELECT * FROM specs_detail WHERE prod_code = ?"
RSsepcsubdetail_cmd.Prepared = true
RSsepcsubdetail_cmd.Parameters.Append RSsepcsubdetail_cmd.CreateParameter("param1", 200, 1, 255, RSsepcsubdetail__MMColParam2) ' adVarChar

Set RSsepcsubdetail = RSsepcsubdetail_cmd.Execute
RSsepcsubdetail_numRows = 0
%>



As you can see, this recordset only has one parameter variable, but my next recordset, on the same page, has the same recordset variable.
This topic has been closed for replies.
Correct answer Newsgroup_User
dnj@fuseail.com wrote:
> Ok, but in my webpage, I have the url for the page, ending in;
>
> admin_specs_2.asp?prod_code=LK-049
>
> I want the value, LK-049 to be available for more than 1 recordset on the
> page, it just wont work.

At the top of your page (code view) use this:

<%
Dim ParamProdCode
ParamProdCode = Request.QueryString("prod_code")
%>

Then in your recordset where it asks for value, just put ParamProdCode.

Dooza
--
Posting Guidelines
http://www.adobe.com/support/forums/guidelines.html
How To Ask Smart Questions
http://www.catb.org/esr/faqs/smart-questions.html

1 reply

Inspiring
February 5, 2009
Change it to what ou want, manually.
dnj1Author
Participant
February 5, 2009
Ok, but in my webpage, I have the url for the page, ending in;

admin_specs_2.asp?prod_code=LK-049

I want the value, LK-049 to be available for more than 1 recordset on the page, it just wont work.