|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Please Help!!!!!
I've been trying to figure this out for a couple of days to no avail. I'm trying to pass a value that I get from one database query (stored in the recordset. To another database query, and I'm getting an error stating that there is a type mismatch. Here is the code. Specifically I'm trying to pass the value of ThreadID that I get from the first query (always returns a single value) storing it in a variabel called ThreadReply, and then using that variable in my second query statement. set rs = Server.CreateObject("ADODB.recordset") sql="SELECT ThreadID FROM TblForumThread WHERE ThreadName='"&Session("ThreadName")&"';" rs.Open sql, conn ThreadReply=rs("ThreadID") rs.Close set rs = Server.CreateObject("ADODB.recordset") sql="SELECT * FROM TblForumReply WHERE ThreadID='"&ThreadReply&"';" rs.Open sql, conn Please Help. |
|
#2
|
||||
|
||||
|
try it this way and see if if helps. i had this same problem a long time ago but i am not sure if this was right for a fix or not :
Code:
sql = "SELECT * FROM TblForumReply WHERE ThreadID='" & CStr(ThreadReply) & "';"
__________________
mr... mike.rusaw@realpage.com RalPage, Inc. "I have made this letter longer than usual, only because I have not had the time to make it shorter." - Blaise Paschal |
|
#3
|
|||
|
|||
|
Thank You
for your quick response. Unfortunately it did not work, is there anything else that I can try. Thanx |
|
#4
|
|||
|
|||
|
if ThreadID is a numeric field in the database then do not enclose the value in single quotes.
__________________
Programmer's Corner |
|
#5
|
|||
|
|||
|
That worked!!!
Thank You very much |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Passing recordset value to a query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|