...

View Full Version : error '80020009' in SQL string



r0ck1t
12-11-2003, 11:47 PM
I am getting this error on the line of an SQL string, anyone see a problem with it?

strSQL = "SELECT forum_sub_cat_read FROM tblForumSubCat WHERE tblForumSubCat.forum_sub_cat_id = " & objRs("topic_forum") & ";"


Error message:

error '80020009'
/forum_posts.asp, line 82

<edit>Using Access DB</edit>
Any help is greatly appreciated!!

-r0ck1t-

oracleguy
12-12-2003, 01:22 AM
What was the error discriptor?

A1ien51
12-12-2003, 02:46 AM
why are you doing this: tblForumSubCat.forum_sub_cat_id
instead of just using forum_sub_cat_id

Eric

glenngv
12-12-2003, 07:07 AM
response.write the sql statement to see if objRs("topic_forum") returns something

strSQL = "SELECT forum_sub_cat_read FROM tblForumSubCat WHERE tblForumSubCat.forum_sub_cat_id = " & objRs("topic_forum") & ";"
response.write strSQL
response.end

r0ck1t
12-12-2003, 08:59 AM
What was the error discriptor?

What do you mean. That was the entire error message.


why are you doing this: tblForumSubCat.forum_sub_cat_id
instead of just using forum_sub_cat_id

Dunno, that is just the way I have always done it.

r0ck1t
12-12-2003, 09:12 AM
Response.Write ing the SQL string helped, it gave me some new errors, which I knew how to solve.

And you were right glenngv, that field was empty.... off to fix that now!!

Thanks guys!

glenngv
12-12-2003, 09:37 AM
To debug sql statements, it always helps to display them before executing them to see if there are syntax errors or what. If there's no syntax error but no records are retrieved, execute the generated sql statement in the db's query analyzer to verify the output.

r0ck1t
12-12-2003, 11:05 AM
Yeah I check all my statements in query analyzer, just didn't know what the problem was this time.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum