lidds Posted December 6, 2004 Posted December 6, 2004 I'm having a problem reading an xml file. <?xml version="1.0" encoding="utf-8"?> <Configuration> <Server> <name>(local)</name> </Server> </Configuration> I'm using the following code but it's giving me an error on the readSettingsInfo.ReadStartElement("Server") line of code. Could someone please point out what I am doing wrong or if there is a better way? Dim readSettingsInfo As Xml.XmlTextReader Dim server As String readSettingsInfo = New Xml.XmlTextReader(Application.StartupPath & "\settings.xml") readSettingsInfo.Read() readSettingsInfo.ReadStartElement("Configuration") Do While (True) readSettingsInfo.ReadStartElement("Server") server = readSettingsInfo.ReadElementString() readSettingsInfo.ReadEndElement() Loop readSettingsInfo.ReadEndElement() readSettingsInfo.Close() MsgBox(server) cheers simon Quote
coldfusion244 Posted December 6, 2004 Posted December 6, 2004 Simon, you will probably want to refer to this thread which I made about the same thing. Here -Sean Quote -Sean
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.