Re: datagrid updating from join to single table

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: SomeoneKnows (SomeoneKnows_at_discussions.microsoft.com)
Date: 01/18/05


Date: Tue, 18 Jan 2005 05:33:11 -0800

Mark,

That sounds like what I need. Yes, I would like an example if you could send
me one, that would help. I understand about building classes but I've had
some trouble getting the DataBindingBehavior, DataSourceBehavior, and this
issue of binding data to a class working properly.

Thanks,
Vince Thompson
vince.thompson@cinbell.com

"Mark J. McGinty" wrote:

> You need to create your own custom data class or user control. (The main
> difference between them is you can bind items on your form graphically, just
> as you do with ADODC.) You will then have control of the recordset that
> underlies the data source object.
>
> You then expose your own AddNew method (as well as others that
> ADODB.Recordset supports) and code as you wish. You can declare the
> recordset With Events (and connection too, if it suits your purposes) and
> then handle relevant events.
>
> It's an almost infinitely more flexible solution than ADODC. I have an
> example if you're interested.
>
>
> -Mark
>
>
> "SomeoneKnows" <SomeoneKnows@discussions.microsoft.com> wrote in message
> news:4FCE1A3C-C0C2-4355-8284-E9E6D6DBA396@microsoft.com...
> >I have a legacy program written in VB6 that I have to update. The program
> >is
> > using a datagrid and ADODC control as it's datasource. The program was
> > using
> > a single table viewed in the datagrid but I must change it to display data
> > from two tables. One table will contain the changing data while the other
> > table is used to display constant (unit_price, etc.) information. When the
> > user enters or modifies data it should modify data in only one of the
> > tables.
> > My select statement is working to display the proper data but inserting a
> > record in the datagrid causes the program to appear to try adding records
> > to
> > both tables instead on only one. FYI, the client's database this program
> > connects to is Oracle.
> >
> > How do I intercept the insert/update procedures to effect only one of the
> > tables? Is there a way to form a SQL statement in the
> > Datagrid1_BeforeUpdate
> > event which overrides the adodc control? Is there some other event I
> > should
> > be looking at or another way to cause the updates to go to only one of the
> > tables?
>
>
>



Relevant Pages

  • Datagrid
    ... Assign a recordset to datagrid or using adodc control. ...
    (microsoft.public.vb.general.discussion)
  • Re: Select query with parameters
    ... Dim rsPatient As ADODB.Recordset ... I am using the following code to populate the datagrid: ... When you Open a recordset you pass an SQL query statement as a string. ...
    (microsoft.public.vb.database.ado)
  • Re: DataGrid not showing programmatic changes
    ... It's been awhile since I've used the DataEnvironment... ... The DataGrid is usually bound to a Data control which in turn ... rsCashbook is a recordset of that Connection with a source of SELECT * FROM ...
    (microsoft.public.vb.general.discussion)
  • Re: MSHFlexGrid aktualisieren
    ... Das MSHFlexgrid hat keine permanente Verbindung zu Deinem Recordset. ... Das DataGrid verwaltet keinen eigenen ... auch automatisch der neue Datensatz zur aktuellen Zeile ... Private Sub Form_Load ...
    (microsoft.public.de.vb.datenbank)
  • Re: Need example of using ADO DataControl and DataGrid control - V
    ... Data appears in the DataGrid just fine. ... > ' Create connection string to access the database ... > ' Bind the recordset to the data grid. ... > Private Sub Command1_Click ...
    (microsoft.public.vb.database.ado)