Обсуждение: Force commit in M$ Access?

Поиск
Список
Период
Сортировка

Force commit in M$ Access?

От
"Fred Parkinson"
Дата:
Folks

Does anyone know if it is possible, when using an Access bound form
against a postgresql table, to force changes to commit?

When the user navigates to a new record Access updates the linked
postgres table, but due to a design flaw in the data structures, my life
would be easier if I could force the changed data to update before the
user navigates to a new record.

My initial solution was to issue an UPDATE query whenever the user
changed the offending data, but that results in the error
"You and another user have updated the same data, do you want
to:Discard changes, Copy to clipboard..." (something like that)
as soon as the user closes the form or moves to a new record.

(Yes, I know the correct answer is to fix the flaw, but the managers
here want to slay dragons with beebee guns and don't want to spend
money.)

Thanks in advance for your help!

Fred Parkinson
Grand Canyon Software
For
The Association of Bay Area Governments
510-464-7931

Re: Force commit in M$ Access?

От
"Aaron Spike"
Дата:
On 18 Feb 2004 at 10:41, Fred Parkinson wrote:
> Does anyone know if it is possible, when using an Access bound form
> against a postgresql table, to force changes to commit?

This is probably a bad idea but
SendKeys "+{ENTER}"
might just work.

Pressing Shift+Enter in a form is supposed to commit changes to the
current record. I'm not sure if there is a cleaner VBA hook into that
functionality.

Aaron Spike


Re: Force commit in M$ Access?

От
"Philippe Lang"
Дата:
Hello,

You can use this routine:

---------------------------
Sub cmdSaveFct()
On Error GoTo cmdSaveFctError

    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

cmdSaveFctExit:
    Exit Sub

cmdSaveFctError:
    MsgBox Err.description
    Resume cmdSaveFctExit
End Sub
---------------------------

Philippe Lang


-----Message d'origine-----
De : pgsql-odbc-owner@postgresql.org [mailto:pgsql-odbc-owner@postgresql.org] De la part de Aaron Spike
Envoyé : mercredi, 18. février 2004 20:39
À : Fred Parkinson; pgsql-odbc@postgresql.org
Objet : Re: [ODBC] Force commit in M$ Access?

On 18 Feb 2004 at 10:41, Fred Parkinson wrote:
> Does anyone know if it is possible, when using an Access bound form
> against a postgresql table, to force changes to commit?

This is probably a bad idea but
SendKeys "+{ENTER}"
might just work.

Pressing Shift+Enter in a form is supposed to commit changes to the current record. I'm not sure if there is a cleaner
VBAhook into that functionality. 

Aaron Spike


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match



Re: Force commit in M$ Access?

От
Matthew and Karen Brown
Дата:
Hi Fred,

You might try the following code in whatever handler you wish (button
click, etc):

        DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70

This will save the current record.

-- Matt Brown

Fred Parkinson wrote:

>Folks
>
>Does anyone know if it is possible, when using an Access bound form
>against a postgresql table, to force changes to commit?
>
>When the user navigates to a new record Access updates the linked
>postgres table, but due to a design flaw in the data structures, my life
>would be easier if I could force the changed data to update before the
>user navigates to a new record.
>
>My initial solution was to issue an UPDATE query whenever the user
>changed the offending data, but that results in the error
>"You and another user have updated the same data, do you want
>to:Discard changes, Copy to clipboard..." (something like that)
>as soon as the user closes the form or moves to a new record.
>
>(Yes, I know the correct answer is to fix the flaw, but the managers
>here want to slay dragons with beebee guns and don't want to spend
>money.)
>
>Thanks in advance for your help!
>
>Fred Parkinson
>Grand Canyon Software
>For
>The Association of Bay Area Governments
>510-464-7931
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>
>

Вложения