borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (DataBase Normalization)Next Topic (update database) New Topic New Poll Post Reply
AndreaVB Forum : Database : Recordset
Poster Message
nounabarbie
Level: Trainee

Registered: 12-03-2006
Posts: 2

icon Recordset

Hi
I have 3 tables:Article,Source and File.
Each article can have multiple filenames.
The fields of table Article are:ArticleID,SourceID,ArticleDate,ArticleCategory
The fields of table Source are:SourceID,SourceName
the fields of Table File:ID,ArticleID,Filename
Select*from Article inner join Source on Article.SourceID=source.SourceID order by ArticleDate
I obtain a number of recordsets from the above query.
Then for each recordset(Rs1),Let's say for the first recordset
Rs1.MoveFirst
I want to apply this query:
Rs2.Open"Select SourceName,ArticleDate,File.Filename from [RS1] inner Join File on Article.ArticleID=File.ArticleID
I want from the above query to have the Filenames corresponding to each Article because in my VB
form I have 2 command buttons:one gives me the article's definition(Date,Source)
and the other gives me the Filename of the current recordset(Article)
The above SQL syntax is it correct?
Thanks

12-03-2006 at 05:46 PM
View Profile Send Email to User Show All Posts | Quote Reply
xtramac
Level: Professor


Registered: 28-08-2005
Posts: 89
icon Re: Recordset

try this one..

select s.SourceName,a.ArticleDate,f.filename from source s, article a, filename f where s.sourceid = a.sourceid and f.articleid = s.articleid

instead of another query against you resultset.. since the resulteset is an array... thats s y your getting a syntax error..


hope this helps...


    

andrew

13-03-2006 at 04:07 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Recordset
Previous Topic (DataBase Normalization)Next Topic (update database) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder