I found code on the MS TechNet website to programatically import XML data from a file into a table in the database. Here is that code:
The code works great, but when I put the filename of my main database in the "opencurrentdatabase" line I get an error message saying that the database is open and cannot be edited. If I use a different filename other than the file I have open it works great.
How can I get the code to run on a form *WITHIN* the DB I want the data to be appended to? Thanks in advance for any help.
CG
Here's another code I got from the MSDN website but it locks up Access:
Code:
Const acAppendData = 2
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\Scripts\Test.mdb"
objAccess.ImportXML "c:\scripts\test.xml", acAppendData
The code works great, but when I put the filename of my main database in the "opencurrentdatabase" line I get an error message saying that the database is open and cannot be edited. If I use a different filename other than the file I have open it works great.
How can I get the code to run on a form *WITHIN* the DB I want the data to be appended to? Thanks in advance for any help.
CG
Here's another code I got from the MSDN website but it locks up Access:
Code:
Application.ImportXML _
DataSource:="c:\Service Report 5-30-08 2_data.xml", _
ImportOptions:=acStructureAndData
Last edited: