getAttribute date Problem

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
All,
The code below works very well to add elements to my database. If you look closely you will see that this line (rs("RoundDate") = "" & score.getAttribute("rd") & "") is remarked out. This is because if it is allowed to run in my .asp file, the
whole thing stops working and an error occurs. I can see that a "short" date date string is being passed that looks liike this "3/14/2012" but the .getAttribute does not like the "date" type string.

Is there a trick to sending dates as an attribute?
Thank you.
<pre class="prettyprint Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc.LoadXML(dataString)
set list = xmlDoc.getElementsByTagName("score") get a list of "score" elements
for each score in list
rs.AddNew
rs("MemberNumber") = "" & score.getAttribute("mn") & ""
rs("Score") = score.getAttribute("rs")
rs("RoundDate") = "" & score.getAttribute("rd") & ""
rs("CourseRating") = score.getAttribute("cr")
rs("SlopeRating") = score.getAttribute("sr")
rs("P1") = score.getAttribute("p1")
rs("P2") = score.getAttribute("p2")
rs("P3") = score.getAttribute("p3")
rs("P4") = score.getAttribute("p4")
rs("P5") = score.getAttribute("p5")
rs("P6") = score.getAttribute("p6")
rs("P7") = score.getAttribute("p7")
rs("P8") = score.getAttribute("p8")
rs("P9") = score.getAttribute("p9")
rs("P10") = score.getAttribute("p10")
rs("CourseID") = score.getAttribute("id")
rs.Update
next[/code]
<br/>
<

View the full article
 
Back
Top