|
-
Aug 25th, 2009, 06:14 AM
#1
Thread Starter
Lively Member
[RESOLVED] Filling a Datagridview with an Access query ?
Hello to everybody.
I am trying to find an answer but no luck so far.
I have an access query which plays flawlesly in Access.I want to use it as a source for a datagridview i use in one of my forms but....given the fact that is a rather big query with some "like" and conditions like ">3" and so on AND the fact it uses tables from 3 different mdb (not to mention is bases on other queries...i 'ill try my best to fix this) what is the best approach .
1st case .Can i retrieve the data simply with NO oledbparameteres and NO " select * xxx where yyy like 'd' ".I think there is a issue with the Oledb connection that "omits" them.To explain better the query right now with the filters in access returns 3 rows, without the filters 30 rows,can i get just the 3 rows to do my job...
2nd case . How should i fill a datagridview using tables from 3 different mdbs.If you can show me an example it would be life saving.
Thanks in advance
-
Aug 25th, 2009, 06:29 AM
#2
-
Aug 25th, 2009, 06:31 AM
#3
Re: Filling a Datagridview with an Access query ?
To the 2nd option, just build three datatables and merge them if they have the same schema...
VB.NET Code:
Dt1.Merge(Dt2) Dt1.Merge(Dt3)
Rate People That Helped You
Mark Thread Resolved When Resolved
-
Aug 25th, 2009, 07:53 AM
#4
Thread Starter
Lively Member
Re: Filling a Datagridview with an Access query ?
When u say merge do u mean simple merge.The case is that my query uses 6 tables from 3 different mdb.When i merge i have available all the tables???
E.g
Mdb1 has tbl1,tbl2,tbl3
mdb2 has tbl4,tbl5
mdb3 has tbl6
with merge i will get all the tables and make a dataset?
-
Aug 25th, 2009, 10:08 AM
#5
Re: Filling a Datagridview with an Access query ?
No, the merge command merges two data tables with the same schema, if the tables are different's you can't merge.
You can put them in the same dataset, just use the add method.
Rate People That Helped You
Mark Thread Resolved When Resolved
-
Aug 26th, 2009, 12:32 AM
#6
Thread Starter
Lively Member
Re: Filling a Datagridview with an Access query ?
i will give it a try ... although today's schedule seems a little heavy.Thanks for the help.
-
Aug 26th, 2009, 01:22 AM
#7
Thread Starter
Lively Member
Re: Filling a Datagridview with an Access query ?
Well i haven't tried yet your suggestion but i tried this.In Dataset Designer i tried to do a LEFT JOIN i need and it seems there is no way of doing this.SO my guess is that i cannot "replicate" the Access query i use and i have to go the hard way with the parameters and so on....
Any idea.
-
Aug 26th, 2009, 04:15 AM
#8
Thread Starter
Lively Member
Re: Filling a Datagridview with an Access query ?
Well i examined my query from another prospective and now it works as it should.Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|