Re: ancora su contatore in rete
[ Nouvelle discussion
| Répondre au groupe
|
it.comp.appl.access ]
cut
Sono ancora impantanato...
per ora ho risolto così gestendo gli errori
Public Function Cnt_Cassa() As Integer
Dim Cnt As Integer
On Error GoTo Cnt_Cassa_err
StrSql = "select * from ContatoreCassa "
Dim RsCntCassa As ADODB.Recordset
Set RsCntCassa = New ADODB.Recordset
RsCntCassa.Open (StrSql), CurrentProject.Connection, adOpenDynamic,
adLockBatchOptimistic
'I = I + 1
Cnt = RsCntCassa!IdContatore
RsCntCassa!IdContatore = Cnt + 1
DoCmd.Save
RsCntCassa.UpdateBatch
Cnt = RsCntCassa!IdContatore
Cnt_Cassa = Cnt
RsCntCassa.Close
Set RsCntCassa = Nothing
Exit Function
' se in errore...
Cnt_Cassa_err:
'
If MsgBox("Errore " & Err.Number & ": " & Err.Description & Chr(13) _
& "Vuoi riprovare a fare un nuovo ordine ?" & Chr(13), vbYesNo + vbQuestion
+ vbDefaultButton2, "Database occupato") = vbNo Then
Exit Function
Else
Cnt_Cassa
MsgBox "Per fare un nuovo ordine seleziona NUOVO", vbInformation,
"Numero scontrino a 0 "
End If
End Function
Comunque credo di non avere intoppato il modo giusto per gestire questo
contatore in rete.
Ringrazio CARLO e ROBERTO per il tempo dedicatomi.
Se qualcuno ha un sistema che funziona e volesse spiegarmelo gliene sarei
grato
Ciao a tutti
Maurizio

|
 cette fonctionnalité est reservée aux membres ayant une session active !
|