Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/04/2005, 00:18
xochitemol
 
Fecha de Ingreso: diciembre-2004
Mensajes: 79
Antigüedad: 19 años, 4 meses
Puntos: 0
ok espero que le entiendas

necesitas una base de datos en acces. te paso el codigo completo :



Private Sub mnuArchivoXML_Click()
frmArchivo.Show
End Sub

Private Sub mnuCreaXML_Click()
Dim msXmlPath As String
Dim db As Connection
Dim myRS As Recordset
Set myRS = New Recordset

On Error GoTo error

Set db = New Connection
msXmlPath = App.Path & "\Datos\Libros.xml"
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; data source=" & App.Path + "\Libros.mdb;Persist Security Info=False"
db.Open
myRS.Open "select * from libro order by LIBROID", db, adOpenStatic, adLockOptimistic
myRS.save msXmlPath, adPersistXML
MsgBox "Se ha creado el archivo: " & msXmlPath, vbInformation, "Atencion"

Exit Sub
error:
MsgBox Err.Description, vbOKOnly + vbInformation, Err.Number
Exit Sub
End Sub

Private Sub mnuPublicacion_Click()
frmPrincipal.Show
End Sub

Private Sub mnuReporte_Click()
Dim objRS As New ADODB.Recordset
Dim msXmlPath As String

objRS.CursorLocation = adUseClient
msXmlPath = App.Path & "\Datos\Libros.xml"
objRS.Open msXmlPath, , , , adCmdFile
If Not objRS.EOF Then
With dtrLibros
Set dtrLibros.DataSource = objRS
.Caption = "Listado de Libros"
.Show
End With
End If
End Sub

Private Sub mnuSalir_Click()
End
End Sub