HI all,
I tried to load xml object from record from database , and when i load it from a string directly , it's loaded successfully
But when connecting to database and take the record that is saved as a string in the form of xml like : <MaintenanceSchedule><MaintenanceItem nScheduleType='2' nDayMask='105' nStartHour='12' nStartMinute='30' nEndHour='6' nEndMinute='30'/></MaintenanceSchedule><MaintenanceSchedule><MaintenanceItem nScheduleType='2' nDayMask='105' nStartHour='12' nStartMinute='30' nEndHour='6' nEndMinute='30'/></MaintenanceSchedule>
the connection to database is done successfullt but the xml object never loaded successfully
My code is :
Dim DB, temp, RS
Dim startHour, startMin, endHour, endMin, dayNum
MsgBox "Done!"
'Creating XML object
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
'XMLString = "<Venues><venue>The Mayflower Theater</venue><venue>Carnegie Hall</venue></Venues>"
'Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
'objXMLDoc.async = False
'objXMLDoc.loadXML(XMLString)
'MsgBox objXMLDoc.text
'Set Root = objXMLDoc.documentElement
'MsgBox (Root.xml)
'Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
'objXMLDoc.async = False
For x= 1 to 5
Set DB = CreateObject ("ADODB.Connection")
DB.Mode = adModeReadWrite
'strGraph = "ABB-RAM-OC3-FIB-1"
DB.Open ("provider of database")
Set RS = CreateObject ("ADODB.Recordset")
Query = "SELECT sMaintenanceSchedule FROM Amer where ID='"&x&"'"
RS.Open Query, DB,1,3
While Not RS.EOF
temp=CStr(RS("sMaintenanceSchedule").Value)
'CStr(temp)
MsgBox temp
boolValue=xmlDoc.loadXML(temp)
MsgBox boolValue
MsgBox objXMLDoc.text
'Set Root = objXMLDoc.documentElement
'MsgBox (Root.xml)
if x=1 Then
frmMyForm.timeinfo.value=temp
End If
if x=2 Then
frmMyForm.timeinfo2.value=temp
End If
if x=3 Then
frmMyForm.timeinfo3.value=temp
End If
if x=4 Then
frmMyForm.timeinfo4.value=temp
End If
if x=5 Then
frmMyForm.timeinfo5.value=temp
End If
RS.MoveNext
Wend
Next
Anyone help me????