| | |
Move actual file DOMDocument()
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Mar 2007
Posts: 5
Reputation:
Solved Threads: 1
I am upgrading a vb 6.0 app to .net and I'm having trouble moving a file. The app retrieves info from an XML. When it's done I try to move the .xml file to a history folder and I'm getting an error:
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file because it is being used by another process.
How do I release the file?
Here's my code
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The process cannot access the file because it is being used by another process.
How do I release the file?
Here's my code
VB.NET Syntax (Toggle Plain Text)
Dim root As MSXML2.IXMLDOMElement Dim objXMLdoc As New MSXML2.DOMDocument30() objXMLdoc.Load(Filename) objXMLdoc.async = False root = objXMLdoc.documentElement.firstChild.firstChild GetXMLData() 'USES XPATH... TO RETRIEVE DATA OutPutRecord() 'outputs retrieved data to an SQL Database MoveFile(Filename) Public Function MoveFile(ByVal strfile As String) As Boolean Dim objfile As New FileInfo(strfile) 'Try objfile.MoveTo(Filename) 'Return True 'Catch ' Return False ' End Try End Function
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
You are still referencing the file thru the objXMLdoc. Try this
objXMLdoc.Load(Filename)
objXMLdoc.async = False
root = objXMLdoc.documentElement.firstChild.firstChild
GetXMLData() 'USES XPATH... TO RETRIEVE DATA
OutPutRecord() 'outputs retrieved data to an SQL Database
objXMLdoc = Nothing
MoveFile(Filename)•
•
Join Date: Mar 2007
Posts: 5
Reputation:
Solved Threads: 1
It turns out I did not show enough of my code in the first post. The process was actually croaking in another section altogether. There is another spot that I create an XML using FSO. I converted it to StreamWriter and I'm up and rolling! Well I'm ready to tackle the next challenge in the app!
Thanks Wayne
Thanks Wayne
![]() |
Similar Threads
- Wireless network file sharing ISP sharing help (Networking Hardware Configuration)
- I Cannot Delete, Move, or Rename a File On My PC. (Viruses, Spyware and other Nasties)
- How do I get rid of xadsjt offeroptimizer? (Viruses, Spyware and other Nasties)
- file wont delete (Windows NT / 2000 / XP)
- Error message on start up - bridge.dll file missing (Viruses, Spyware and other Nasties)
- Move the Paging File in Windows XP (Windows tips 'n' tweaks)
- COMPUTER FREEze when moving file (Windows NT / 2000 / XP)
Other Threads in the VB.NET Forum
- Previous Thread: VisualFox Pro ClassLibrary
- Next Thread: datetimepicker
Views: 2468 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application array arrays basic bing browser button buttons c# center check checkbox code convert crystalreport cuesent data database datagrid datagridview date datetimepicker dissertation dissertations dissertationtopic dropdownlist eclipse excel fade file-dialog filter ftp generatetags google gridview images inline input insert intel internet lib listview mobile monitor net objects output panel passingparameters pdf picturebox port position print printing problem read remove save searchbox searchvb.net select serial settings shutdown soap sorting survey table tcp temperature textbox timer timespan transparency trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet visual visualbasic visualbasic.net visualstudio2008 web webbrowser winforms wpf year





