-
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="VBSCRIPT" %>
<%param=Request.QueryString("param"%>
I build the sql like this:
sql="SELECT * FROM tblStudentInfo "
sql=sql & "WHERE [" & cstr(Param) & "] = " & "'" & criteria & "'"%>
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
-
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="VBSCRIPT" %>
<%param=Request.QueryString("param"%>
I build the sql like this:
sql="SELECT * FROM tblStudentInfo "
sql=sql & "WHERE [" & cstr(Param) & "] = " & "'" & criteria & "'"%>
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
-
Forum Rules
|
|