By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Questions pertaining to adding rows in a recordset.

P: 5
I have a couple of questions about recordsets:

1. When a recordset is summoned by the code where does it actually exist and in what form...is it created in the database (data source location) as a new table that mimics the actual database table and contains the fields and rows asked for in the query? It is somewhat vague as to it's true nature in the materials I have rummaged through lately.

2. When an UPDATE code command is given does the edited value on the recordset immediately get placed in the actual corresponding table in the database...or does the edited value get changed on the recordset and then after the recordset session is closed the recordset passes the edited values to the permanent table in the database.

3. Finally, When new rows are added to a recordset using ADDNEW I believe that the new rows must be unique in the sense that they cannot overwrite already existing rows that have the same fields, query indexes, and the same information. For example if one were to have a row of data on a table in the database/recordset with a timestamp field (the field the query for the recordset was based on) for 200 hrs and another field on the same row that held the water temperature for that time, could one add a new row of data with the exact same time stamp and data value or would an error message be produced. Or would the new row be created and simply be a duplicate row that would be placed in the data base.

If you could clear this up it would be appreciated. Thanks
Mar 7 '07 #1
Share this Question
Share on Google+
5 Replies


vijaydiwakar
100+
P: 579
I have a couple of questions about recordsets:

1. When a recordset is summoned by the code where does it actually exist and in what form...is it created in the database (data source location) as a new table that mimics the actual database table and contains the fields and rows asked for in the query? It is somewhat vague as to it's true nature in the materials I have rummaged through lately.

2. When an UPDATE code command is given does the edited value on the recordset immediately get placed in the actual corresponding table in the database...or does the edited value get changed on the recordset and then after the recordset session is closed the recordset passes the edited values to the permanent table in the database.

3. Finally, When new rows are added to a recordset using ADDNEW I believe that the new rows must be unique in the sense that they cannot overwrite already existing rows that have the same fields, query indexes, and the same information. For example if one were to have a row of data on a table in the database/recordset with a timestamp field (the field the query for the recordset was based on) for 200 hrs and another field on the same row that held the water temperature for that time, could one add a new row of data with the exact same time stamp and data value or would an error message be produced. Or would the new row be created and simply be a duplicate row that would be placed in the data base.

If you could clear this up it would be appreciated. Thanks
Solutions
1. Recordset is pointer to context area its created on client machine but by assigning its cursorlocation property to server or to client lets the recordset use the consern liabraries of client or server machine
If ur thinking of recordset from db side then yes it is created on server whenevr the qry is get fired then context area is reserved for that qry
2. See whenevr any DML qry gets fired then from frontend u need to commit it i.e. u've to use explicit commit or rollback until that the changes are saved in buffer it doesn't affect the database directly
3. See the timestamp is mantainded by db itself so there is no duplicasy but suppose there is duplicasy then db (oracle) maintain it by using RowId so each and every record is unique

IF still some problem persists contact me
Mar 7 '07 #2

100+
P: 1,646
1. You can consider a recordset to be an array with methods. The data is stored in memory on your local computer. You use the methods to get at the data in the array (or collection). The recordset object, depending on the type, maintains any required connection to the database.

2. The database is updated immediately with any changes unless there is a problem as below

3. New rows must be unique only if a field or combination of fields is set in the database to be unique. If the database is supplying a datestamp or autonumber field as the only unique value then you cannot screw it up. If, on the other hand, you are supplying the unique value you must be careful to not add a duplicate value that the database will reject. You can only add duplicate field values to fields that have been set up in the database to allow duplicates.
Mar 7 '07 #3

P: 5
1. You can consider a recordset to be an array with methods. The data is stored in memory on your local computer. You use the methods to get at the data in the array (or collection). The recordset object, depending on the type, maintains any required connection to the database.

2. The database is updated immediately with any changes unless there is a problem as below

3. New rows must be unique only if a field or combination of fields is set in the database to be unique. If the database is supplying a datestamp or autonumber field as the only unique value then you cannot screw it up. If, on the other hand, you are supplying the unique value you must be careful to not add a duplicate value that the database will reject. You can only add duplicate field values to fields that have been set up in the database to allow duplicates.


Thanks for your assistance!
Mar 7 '07 #4

P: 5
Solutions
1. Recordset is pointer to context area its created on client machine but by assigning its cursorlocation property to server or to client lets the recordset use the consern liabraries of client or server machine
If ur thinking of recordset from db side then yes it is created on server whenevr the qry is get fired then context area is reserved for that qry
2. See whenevr any DML qry gets fired then from frontend u need to commit it i.e. u've to use explicit commit or rollback until that the changes are saved in buffer it doesn't affect the database directly
3. See the timestamp is mantainded by db itself so there is no duplicasy but suppose there is duplicasy then db (oracle) maintain it by using RowId so each and every record is unique

IF still some problem persists contact me
Thanks for your assistance!
Mar 7 '07 #5

100+
P: 1,646
Thanks for your assistance!
You are very welcome Joe
Mar 7 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.