![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Access 2003. On a form, I press a button that updates a table using ADODB .Seek and .Update. |
|
Then I press a second button that does DoCmd.OpenQuery. |
|
The query SOMETIMES doesn't reflect the change I've just made to the underlying table. The query ALWAYS gives correct results when it's run a second time, or when I switch it from Datasheet View to Design View and back. Waiting a few seconds between pressing the two buttons doesn't help. I've tried adding an ADODB.Command and using it to surround my VB update code with BEGIN TRANSACTION and COMMIT. No effect. Ideas for diagnosing this puzzling behavior? |
#3
| |||
| |||
|
|
Access 2003. On a form, I press a button that updates a table using ADODB .Seek and .Update. Then I press a second button that does DoCmd.OpenQuery. The query SOMETIMES doesn't reflect the change I've just made to the underlying table. The query ALWAYS gives correct results when it's run a second time, or when I switch it from Datasheet View to Design View and back. Waiting a few seconds between pressing the two buttons doesn't help. I've tried adding an ADODB.Command and using it to surround my VB update code with BEGIN TRANSACTION and COMMIT. No effect. Ideas for diagnosing this puzzling behavior? |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
By the way, David, I never "walked the recordset". Using Seek with the primary key and adSeekFirstEq is probably just as efficient as CurrentDb.Execute. |
#6
| |||
| |||
|
|
Bob, the KB articles enlightened me. I wish I could have used the techniques they describe, but I have no control over the way Access executes a query, so I can't use JRO.JetEngine.RefreshCache and therefore I can't guarantee that the "reader" will pick up the latest changes. |
#7
| |||
| |||
|
#8
| |||
| |||
|
|
What do you mean, ADO is dead? I guess I have to slightly disagree with David. |
|
I'm using Access 2003 and ADO works fine. I have no reason to change Access versions, as my clients are all on Access 2000 or 2003, so if you're telling me that Microsoft has dropped support for ADO in later versions of Access, then it's irrelevant to me, and if you're not telling me that, then why say "ADO is dead"? Would DAO allow me to create a recordset without an underlying table, as in Set rs = New ADODB.Recordset ? |
|
Would DAO allow me to store open recordsets in a Collection? |
#9
| |||||||||
| |||||||||
|
|
What do you mean, ADO is dead? |
|
I'm using Access 2003 and ADO works fine. |
|
I have no reason to change Access versions, as my clients are all on Access 2000 or 2003, so if you're telling me that Microsoft has dropped support for ADO in later versions of Access, then it's irrelevant to me, and if you're not telling me that, then why say "ADO is dead"? |
|
Would DAO allow me to create a recordset without an underlying table, as in Set rs = New ADODB.Recordset ? |
|
Would DAO allow me to store open recordsets in a Collection? |
|
These are honest questions. I don't know the answers. I'm not especially opinionated or argumentative. I just turn to newsgroups where I have learned that many people try to help each other. Thanks for any help. |
|
By the way, Seek does not "walk the recordset", |
|
because it finds what it needs in the Index. Indexes are held separately from the data, are very concise for their purpose, and may be tree-shaped if the table is large, to minimize "walking". |
|
And batch updates were never a possibility for my app. One user presses one button and I have to react to it. |
#10
| ||||
| ||||
|
|
Composer wrote: What do you mean, ADO is dead? I guess I have to slightly disagree with David. ADO of course is as dead as DAO. |
|
ADO.Net is the new paradigm. Additionally, DAO is single-threaded, so if your application is multi-threaded (such as a web application), you need to use ADO. |
|
Otherwise, DAO is more tightly integrated with Jet and therefore is the data access library of choce for most people creating single-threaded apps - better performance and more functionality. |
|
There are many things you can do with DAO that you will never be able to do with ADO (Stephen Lebans used to have a great article on his site detailing these, but he has retired from Access support so I can't seem to find the article on his site anymore. If you're really interested, you can try using the Wayback Machine at www.archive.org to find cached versions of his old site www.trigeminal.com and see if you can get the article that way.). However, the reverse is also true. See below |
![]() |
| Thread Tools | |
| Display Modes | |
| |