XML - Salvataggio RecordSet in XML e Lettura XML




'**********************************************

' Apertura del file XML in un Recordset

'**********************************************

' rs.Close

' rs.Open App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml", , adOpenStatic, adLockReadOnly, adCmdFile

'

'

' For I = 0 To rs.Fields.Count - 1

' Debug.Print rs.Fields(I).Name & " = " & Chr(34) & rs.Fields(I).Value & Chr(34)

' Next

'**********************************************




'*********************************************

' Salvataggio recordset In XML

'*********************************************


Set rs = New Recordset
rs.Open "Select * from Fornitori where idFornitore = " & IdCancella, DbAzienda, adOpenStatic, adLockOptimistic
'******************

'salvataggio XML

'******************

If rs.RecordCount > 0 Then
If Dir(App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml") <> "" Then
Kill App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml"
End If
rs.Save App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml", adPersistXML
'******************

Do
If Dir(App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml") <> "" Then
Exit Do
End If
Loop
End If





Vedi FrmCancella progetto Agentex '**********************************************
' Apertura del file XML in un Recordset

'**********************************************

' rs.Close

' rs.Open App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml", , adOpenStatic, adLockReadOnly, adCmdFile

'

'

' For I = 0 To rs.Fields.Count - 1

' Debug.Print rs.Fields(I).Name & " = " & Chr(34) & rs.Fields(I).Value & Chr(34)

' Next

'**********************************************




'*********************************************

' Salvataggio recordset In XML

'*********************************************


Set rs = New Recordset
rs.Open "Select * from Fornitori where idFornitore = " & IdCancella, DbAzienda, adOpenStatic, adLockOptimistic
'******************

'salvataggio XML

'******************

If rs.RecordCount > 0 Then
If Dir(App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml") <> "" Then
Kill App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml"
End If
rs.Save App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml", adPersistXML
'******************

Do
If Dir(App.Path & "\Backup\Fornitore_" & Stringa & "_Anagrafica.xml") <> "" Then
Exit Do
End If
Loop
End If





Vedi FrmCancella progetto Agentex










( xmlsalvataggiorecordsetinxmleletturaxml.html )- by Paolo Puglisi - Modifica del 17/12/2023