C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.
Sign in
|
Join
|
Help
Home
Blogs
Forums
Forums
»
ActiveX
»
True DataControl
»
stored procedures (add new and deletes with TData control)
stored procedures (add new and deletes with TData control)
rated by 0 users
This post has 1 Reply | 0 Followers
Posts
89,785
Reply
newsgroup_archive
Posted: Thu, Jan 19 2006 4:20 PM
rated by 0 users
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).
Posts
89,785
Reply
newsgroup_archive
replied on
Fri, Jan 20 2006 7:33 PM
rated by 0 users
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).
Previous
|
Next
Page 1 of 1 (2 items) |
RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.