March 13, 2006 at 11:21 am
HiI have a table with 3 fields;My table's name is Filename and it has 3 fields:ID(autoincrement),ArticleID and FilenameI have a VB form and I obtain the articleID from a recordset.I want to use my ArticleID in order to retrieve all the filenames corresponding to the ArticleIDI assigned aId=Rs1!ArticleIDRs2.Open"Select Filename from Filename where ArticleID=aId" It gave me an error(in my VB form).Why?Can someone help me?thanks
March 13, 2006 at 11:40 am
Welcome to the forum.
Concatenate the value behind, since the parser doesn't know the value of =aId"
Rs2.Open "Select Filename from Filename where ArticleID=" & aId
Even better would be using a stored procedure. (performance,security, reuse...)
March 27, 2006 at 7:09 am
Plus...if you'd had the SQL statement in a string variable you could've used the debugging window to print out the sql statement/variables etc.. and run it directly in QA to trace the problem...or in this case, you'd have seen immediately that the variable wasn't being passed..you can do this even when you convert to (Jo's suggestion of using) an sp..
**ASCII stupid question, get a stupid ANSI !!!**
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply