stored procedures (add new and deletes with TData control)

ActiveX

ActiveX controls

stored procedures (add new and deletes with TData control)

  • rated by 0 users
  • This post has 1 Reply |
  • 0 Followers

  • Hi all,
    I just inherited a VB6 project that uses a componentone controls for everything. There is one thing that is confusing the heck out of me. There is a tdata control that has the following setup:
    DataMode: 0 - DataSource
    CommandType: StoredProc
    LockType: LockOptimistic
    Connention is to a SQL database

    The store procedure is a simple select query from one table. How does the tdata control able to add new rows and delete rows back to the database. There is no code specifing how this should be done. If the store procedure was something more complicated with joins and so forth, would how could add and delete rows?

    Please help ... I'm starting to go mad
    Sean

    Click here to view the original newsgroup article (read only).


  • Alright, I did some testing today. I appears to me that the data control is smart enough to read the stored procedure and deduce what a suitable insert and update sql statement should be.

    Please correct me if I'm wrong.

    If the stored procedure returns a recordset from a temp table the data control won't work. I believe records sets based on multiple joins cannot update and insert with the data controls default functionality. Also if the record set does not contain all of the non nullable fields the insert will produces an error.

    This control is pretty smart. I tried to trick with a procedure that returned a select statement with on join. I placed the child table first in my statement and the control still updated and inserted into the parent table. I didn't think it would catch that.

    Happy coding,
    s.tuck




    "Sean" wrote:
    >
    >Hi all,
    >I just inherited a VB6 project that uses a componentone controls for everything. There is one thing that is confusing the heck out of me. There is a tdata control that has the following setup:
    >DataMode: 0 - DataSource
    >CommandType: StoredProc
    >LockType: LockOptimistic
    >Connention is to a SQL database
    >
    >The store procedure is a simple select query from one table. How does the tdata control able to add new rows and delete rows back to the database. There is no code specifing how this should be done. If the store procedure was something more complicated with joins and so forth, would how could add and delete rows?
    >
    >Please help ... I'm starting to go mad
    >Sean
    >

    Click here to view the original newsgroup article (read only).

Page 1 of 1 (2 items)