problem creating recordset from two tables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruno Luis

    #1

    problem creating recordset from two tables

    Hello

    I'm using A97 and i'm having some trouble with creating a recordset
    with data from two different databases.

    I connect to a remote database and make this data the default source
    for my continuous form (Set me.recordset = rs). The problem is: one of
    the fields of the remote database is a foreign key (two digit number),
    and the table with the correspondence is in my local database... i
    have no way of altering the remote database. And i need it to be on
    the recordset, as it is the source of my form.

    Any ideas on what steps should i take?

    Thanks so much

    Bruno Luis
  • Pavel Romashkin

    #2
    Re: problem creating recordset from two tables

    Given the case you describe *exactly* as it is, I would use unbound
    forms and get the data from the local table in SQL using the FK from the
    rs.record of interest.
    If I really wanted to use bound forms I'd find another way to get server
    datya, like linked tables.

    Pavel

    Bruno Luis wrote:[color=blue]
    >
    > Hello
    >
    > I'm using A97 and i'm having some trouble with creating a recordset
    > with data from two different databases.
    >
    > I connect to a remote database and make this data the default source
    > for my continuous form (Set me.recordset = rs). The problem is: one of
    > the fields of the remote database is a foreign key (two digit number),
    > and the table with the correspondence is in my local database... i
    > have no way of altering the remote database. And i need it to be on
    > the recordset, as it is the source of my form.
    >
    > Any ideas on what steps should i take?
    >
    > Thanks so much
    >
    > Bruno Luis[/color]

    Comment

    • Bruno Luis

      #3
      Re: problem creating recordset from two tables

      But how can i create a bound form? How can i link a local table to a
      remote table by code?

      Thanks

      Bruno Luis


      Pavel Romashkin <pavel_romashki n@hotmail.com> wrote in message news:<3F79C0CF. 34346F04@hotmai l.com>...[color=blue]
      > Given the case you describe *exactly* as it is, I would use unbound
      > forms and get the data from the local table in SQL using the FK from the
      > rs.record of interest.
      > If I really wanted to use bound forms I'd find another way to get server
      > datya, like linked tables.
      >
      > Pavel
      >
      > Bruno Luis wrote:[color=green]
      > >
      > > Hello
      > >
      > > I'm using A97 and i'm having some trouble with creating a recordset
      > > with data from two different databases.
      > >
      > > I connect to a remote database and make this data the default source
      > > for my continuous form (Set me.recordset = rs). The problem is: one of
      > > the fields of the remote database is a foreign key (two digit number),
      > > and the table with the correspondence is in my local database... i
      > > have no way of altering the remote database. And i need it to be on
      > > the recordset, as it is the source of my form.
      > >
      > > Any ideas on what steps should i take?
      > >
      > > Thanks so much
      > >
      > > Bruno Luis[/color][/color]

      Comment

      • Pavel Romashkin

        #4
        Re: problem creating recordset from two tables

        The main form does not have resord source at design time. You still can
        make controls on the main form bound to field names in the remote
        recordset, although they will not work unless you do provide the
        recordset at load time. Make a hidden textbox that has FK as its record source.
        However, your local data seems to have related records to be displayed
        in a subform. Bind the local data to the subform and link its key field
        to the hidden textbox of the main form that contains the FK.
        Once you attach the rst in the Load event, the form/subform will operate
        as expected.
        Cheers,
        Pavel
        P.S. I may have mixed which dataset is One and which is Many, but it
        doesn't matter. Basically, lay out the Form/Subform as if both datasets
        were local and link their Parent/Child fields. Then remove the
        recordsource for the remote-based form and attach it in the Load event.

        Bruno Luis wrote:[color=blue]
        >
        > But how can i create a bound form? How can i link a local table to a
        > remote table by code?
        >
        > Thanks
        >
        > Bruno Luis
        >
        > Pavel Romashkin <pavel_romashki n@hotmail.com> wrote in message news:<3F79C0CF. 34346F04@hotmai l.com>...[color=green]
        > > Given the case you describe *exactly* as it is, I would use unbound
        > > forms and get the data from the local table in SQL using the FK from the
        > > rs.record of interest.
        > > If I really wanted to use bound forms I'd find another way to get server
        > > datya, like linked tables.
        > >
        > > Pavel
        > >
        > > Bruno Luis wrote:[color=darkred]
        > > >
        > > > Hello
        > > >
        > > > I'm using A97 and i'm having some trouble with creating a recordset
        > > > with data from two different databases.
        > > >
        > > > I connect to a remote database and make this data the default source
        > > > for my continuous form (Set me.recordset = rs). The problem is: one of
        > > > the fields of the remote database is a foreign key (two digit number),
        > > > and the table with the correspondence is in my local database... i
        > > > have no way of altering the remote database. And i need it to be on
        > > > the recordset, as it is the source of my form.
        > > >
        > > > Any ideas on what steps should i take?
        > > >
        > > > Thanks so much
        > > >
        > > > Bruno Luis[/color][/color][/color]

        Comment

        Working...