Results 1 to 2 of 2

Thread: aspDB passing variables to SQL problems

  1. #1
    Bob Cummings Guest

    aspDB passing variables to SQL problems


    I have downloaded the aspDB free component and intended to recommend to my manager that we buy the Pro version when I return to work - I am very impressed.

    I have a problem that you may be able to solve. I am passing a parameter from a previous link to form part of my dbSQL string like this:

    <% @LANGUAGE=&#34;VBSCRIPT&#34; %>
    <%param=Request.QueryString(&#34;param&#34%>

    I build the sql like this:

    sql=&#34;SELECT * FROM tblStudentInfo &#34;
    sql=sql & &#34;WHERE [&#34; & cstr(Param) & &#34;] = &#34; & &#34;&#39;&#34; & criteria & &#34;&#39;&#34;%>

    Mydb.dbSQL=sql

    This displays the first grid page fine but when I click next, the criteria value is empty, I get an error msg and no more records are displayed.

    Can anyone help?

    Bob Cummings

  2. #2
    Mark Guest

    aspDB passing variables to SQL problems (reply)

    Bob,

    This is a common problem. You MUST save the passed values in session variables, otherwise they will be null on subsequent displays. There is a very good programming example of how (and when) to do this. Notice the need to do a dbReset also. See Programming Example D5a at http://www.aspdb.com

    Mark.

    ------------
    Bob Cummings at 1/2/00 7:38:26 AM


    I have downloaded the aspDB free component and intended to recommend to my manager that we buy the Pro version when I return to work - I am very impressed.

    I have a problem that you may be able to solve. I am passing a parameter from a previous link to form part of my dbSQL string like this:

    <% @LANGUAGE=&#34;VBSCRIPT&#34; %>
    <%param=Request.QueryString(&#34;param&#34%>

    I build the sql like this:

    sql=&#34;SELECT * FROM tblStudentInfo &#34;
    sql=sql & &#34;WHERE [&#34; & cstr(Param) & &#34;] = &#34; & &#34;&#39;&#34; & criteria & &#34;&#39;&#34;%>

    Mydb.dbSQL=sql

    This displays the first grid page fine but when I click next, the criteria value is empty, I get an error msg and no more records are displayed.

    Can anyone help?

    Bob Cummings

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •