amorosik
Active member
- Local time
- Today, 23:24
- Joined
- Apr 18, 2020
- Messages
- 688
Why the row InserisciRecordPrincipale = rs("ID_FERICEVUTE") not recognize rs("ID_FERICEVUTE")?
When RS.UPDATE is invoked, rs("ID_FERICEVUTE") lost his value
Going step by step, you can see that the rs("id_fericevute") is correctly readable up to the rs.update line
Without Close, or Move, why the field is not readable?
When RS.UPDATE is invoked, rs("ID_FERICEVUTE") lost his value
Going step by step, you can see that the rs("id_fericevute") is correctly readable up to the rs.update line
Without Close, or Move, why the field is not readable?
Code:
Private Function InserisciRecordPrincipale(db As DAO.Database, NOME_FILE As String, hash As String, b64 As Boolean, nom_fil_ser_ftp As String) As Long
Dim rs As DAO.Recordset
Set rs = db.OpenRecordset("FERICEVUTE", dbOpenDynaset)
rs.AddNew
rs("ID_FERICEVUTE") = NUOVO_VALORE_DA_GENERATORE_GLOBALE()
Call dati_testata_record(rs, "INSERIMENTO")
rs("ID_DOCUMENTITESTATE") = 0
rs("ID_MOVIMENTICONTABILITESTATE") = 0
rs("NOME_FILE_COMPLETO") = NOME_FILE
rs("NOME_FILE") = solo_nome_file(NOME_FILE)
rs("HASH_MD5_DEL_FILE") = FileToMD5(NOME_FILE, b64)
rs("HASH_SHA256_DEL_FILE") = hash
rs("HASH_SHA512_DEL_FILE") = FileToSHA512(NOME_FILE, b64)
rs("DATA_RICEZIONE") = data_ora_file(NOME_FILE, "CREAZIONE")
rs("DATA_IMPORTAZIONE") = Format$(Now, "dd/mm/yyyy hh:mm:ss")
rs("FLAG_SELEZIONA") = 0
rs("FLAG_CARICATO") = 0
rs("FLAG_CONTABILIZZATO") = 0
rs("NOME_FILE_SU_FTP_SERVER") = nom_fil_ser_ftp
rs("FLAG_VENDITA") = IIf(vendita_acquisto = "VENDITA", -1, 0)
rs("NUMERO_FILE_ALLEGATI") = 0
rs("ANNOTAZIONI") = ""
rs.Update
InserisciRecordPrincipale = rs("ID_FERICEVUTE")
rs.Close
End Function