Home All Groups Group Topic Archive Search About

Dataset creation problem.........

Author
31 Jan 2006 7:04 AM
sendtobiren
Hi All,

I have two access databases. First contains a table which contains
userids. The second one contains the users records.

I tried to create a dataset which will query in these two databases and
get two datatables. I tried to add relation between these two
datatables.

But while setting the relationship it gives error because each & every
records in the first table does not contain related records in the
second table.

e.g.

Table 1                                     Table 2
---------------------------  --------------------------------------
Id       UserId            UserId              UserName
---------------------------  -------------------------------------
1        1001               1001                User One
2        1001               1002                User Two
3        1002               1003                User Three
                                1004                User Four

Can anyone help me in this issue...............

Thanks,
Biren.

Author
31 Jan 2006 7:45 AM
Cor Ligthert [MVP]
Biren,

This should not be possible if you have a relation.

I know that in real live with children from who the parents are missing this
happens as well, however in a database you should in my opinion create in
those cases a parent with the name "Parent Missing".

You can choise in this by creating it in your database or in your datatable
extra rows by first looping through your Table2, use that to find the parent
in table1 and if that one does not exist create a dummy one. (it is up to
you if you do update that one in your database).

Than you can set the relation.

I hope this helps,

Cor
Author
31 Jan 2006 4:17 PM
CLR
I think this problem is similar to what I have encountered in the past.  Is
it possible to use a LEFT OUTER JOIN with Access (like in TSQL?) Putting it
into your read procedure you could thus create one table in your dataset

Show quote
"sendtobi***@gmail.com" wrote:

> Hi All,
>
> I have two access databases. First contains a table which contains
> userids. The second one contains the users records.
>
> I tried to create a dataset which will query in these two databases and
> get two datatables. I tried to add relation between these two
> datatables.
>
> But while setting the relationship it gives error because each & every
> records in the first table does not contain related records in the
> second table.
>
> e.g.
>
> Table 1                                     Table 2
> ---------------------------  --------------------------------------
> Id       UserId            UserId              UserName
> ---------------------------  -------------------------------------
> 1        1001               1001                User One
> 2        1001               1002                User Two
> 3        1002               1003                User Three
>                                 1004                User Four
>
> Can anyone help me in this issue...............
>
> Thanks,
> Biren.
>
>

AddThis Social Bookmark Button