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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace Request.QueryString

Status
Not open for further replies.
Aug 1, 2003
85
US
Is there a way to replace the [Request.QueryString("pagelinkiddetail")] with code that will allow me to insert data from another recordset with several lines?

example; table (linkdetail) has 6 entries in the pagelinkid column 1,2,3,4,5,and 6


<%
Dim Recordset2__MMColParamm
Recordset2__MMColParamm = "0"
If (Request.QueryString("UserID") <> "") Then
Recordset2__MMColParamm = Request.QueryString("pagelinkiddetail")
End If
%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_conntesttsrserv_STRING
Recordset2.Source = "SELECT useraccess.UserID, useraccess.Username, linkdetail.pagelinkIDdetail, pagelinks.pagelinks FROM useraccess INNER JOIN (pagelinks INNER JOIN linkdetail ON pagelinks.pagelinkID = linkdetail.pagelinkIDdetail) ON useraccess.UserID = linkdetail.userID WHERE useraccess.UserID<>" + Replace(Recordset2__MMColParam, "'", "''") + " and linkdetail.pagelinkiddetail<>" + Replace(Recordset2__MMColParamm, "'", "''") + ""
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>

without a repeat region it only comes up with the first entry, but I can't get the repeat to work in the recordset. (not sure if it's me or a limitation).
Do I need an array?

Thanks,
Dan
 
use

linkdetail.pagelinkiddetail NOT IN Replace(Recordset2__MMColParamm, "'", "''")

-DNG
 
I tried that and got
In operator without () in query expression 'useraccess.UserID<>1 and linkdetail.pagelinkiddetail NOT IN Replace(Recordset2__MMColParamm,'

Am I using it wrong? someone needs to come poke me in my eye
 
your query should look like this...

linkdetail.pagelinkiddetail NOT IN (1,2,4,5,6)

so format your query string accordingly...

-DNG
 
it worked like this

<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_conntesttsrserv_STRING
Recordset2.Source = "SELECT useraccess.UserID, useraccess.Username, linkdetail.pagelinkIDdetail, pagelinks.pagelinks FROM useraccess INNER JOIN (pagelinks INNER JOIN linkdetail ON pagelinks.pagelinkID = linkdetail.pagelinkIDdetail) ON useraccess.UserID = linkdetail.userID WHERE useraccess.UserID<>" + Replace(Recordset2__MMColParam, "'", "''") + " and linkdetail.pagelinkiddetail NOT IN (1,2,4,5,6)"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>

but the problim is it's not dynamic.
what about different users, not to mention adding additional pagelinks in the future?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top