Click to See Complete Forum and Search --> : ADO writes in Access 2002/XP not timely


M Owen
February 24th, 2003, 08:32 AM
Hi all.

Thought I'd try this question in here ...

Bear with me for a minute ... I have a form in Access that is bound to a table. This form calls another form (i.e. a "Review" form calling an "Entry" form) where the Entry form will add a record to the table the parent form is bound to. Now, I use ADO to do this. Using the ADODB.Connection and open a recordset and do an AddNew, push across my fields and then do an Update. I even close and reopen the connection. When I leave the Entry form and return to the Review form and Requery the table sometimes the record just added doesn't show up. I have to go in and out of the Entry form (just enter and exit) a couple times and <POOF> the record finally shows up. Anyone have an idea on how to get this lazy ADO pig to work a little bit more faster?

P.S. I have other code that does commits with the same type of result ...

Thanks!

- Mike

M Owen
February 24th, 2003, 08:34 AM
Tidbit of info to pass along ... My entry form HAS to use an ADO recordset because of field constaints. I have some textboxes where apostrophes and quotations are allowed. Obviously the Execute method of the ADO connection cannot be used. Back to my problem ...

The recordset I create is a dynamic lock optimistic recordset where I do the .AddNew and .Update which puts the new record in the temp table bound to the parent form. The problem is that there seems to be a real timing issue when I add the record and exit the child form. Sometimes the .Requery of the form will display the record and sometimes not. It's about 50-50 ... This is a known issue with VB and Access with the Jet engine (Seen it myself and am still pulling out my hair ) The relatively universal means of correcting this is to close and reopen the ADO connection. I do that AND it still doesn't work all the time. I'm hoping someone has a tried and true method that I could use ...

- Mike

antares686
February 25th, 2003, 05:41 AM
Tidbit of info to pass along ... My entry form HAS to use an ADO recordset because of field constaints. I have some textboxes where apostrophes and quotations are allowed. Obviously the Execute method of the ADO connection cannot be used. Back to my problem ...

Actually you can use it just fine.

Use the Replace function to replace ' with '' and " with "" and the execute will be just fine.

I haven't looked into detail yet at the .AddNew issue.