Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Reuse parameters in variables

New Here ,
Feb 03, 2009 Feb 03, 2009
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.
TOPICS
Server side applications
429
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Feb 05, 2009 Feb 05, 2009
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...
Translate
LEGEND ,
Feb 05, 2009 Feb 05, 2009
Change it to what ou want, manually.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2009 Feb 05, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2009 Feb 05, 2009
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines