R
Ram Lindsey
I am trying to create and populate an Access database using the
application.ImportXML method from a program written in VB .Net. When I use
Access to import the Schema everything works fine so I assume the XML is
good.
When the code calls the ImportXML method, I get the following exception:
An unhandled exception of type 'System.InvalidCastException' occurred in
microsoft.visualbasic.dll
Additional information: Cast from string "Exception from HRESULT: 0x800C00"
to type 'Integer' is not valid.
I would appreciate any and all advice. Following is the code.
dsExport.WriteXml("Transfer.xml")
Dim oAccApp As New Access.Application
Try
oAccApp.OpenCurrentDatabase(strFileName, False)
oAccApp.ImportXML("Transfer.xml",
Access.AcImportXMLOption.acAppendData)
Catch ex As Exception
MsgBox("Access Import Error:", ex.Message)
Finally
oAccApp.CloseCurrentDatabase()
oAccApp.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccApp)
oAccApp = Nothing
End Try
application.ImportXML method from a program written in VB .Net. When I use
Access to import the Schema everything works fine so I assume the XML is
good.
When the code calls the ImportXML method, I get the following exception:
An unhandled exception of type 'System.InvalidCastException' occurred in
microsoft.visualbasic.dll
Additional information: Cast from string "Exception from HRESULT: 0x800C00"
to type 'Integer' is not valid.
I would appreciate any and all advice. Following is the code.
dsExport.WriteXml("Transfer.xml")
Dim oAccApp As New Access.Application
Try
oAccApp.OpenCurrentDatabase(strFileName, False)
oAccApp.ImportXML("Transfer.xml",
Access.AcImportXMLOption.acAppendData)
Catch ex As Exception
MsgBox("Access Import Error:", ex.Message)
Finally
oAccApp.CloseCurrentDatabase()
oAccApp.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccApp)
oAccApp = Nothing
End Try