p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   XML (http://p2p.wrox.com/forumdisplay.php?f=91)
-   -   problem reading a value from an xml (http://p2p.wrox.com/showthread.php?t=58829)

mrjoka June 8th, 2007 09:41 AM

hi, sorry for the late reply, i was out of the office.
i do not have any kind of errors when running the page but when i check the database i do not find records for locationid

in the begining of the page i declare my variables:
dim locationid

i have a sub:
sub Addlocation()

xmlReq = "http://tools.locatienet.com/xml.1/finder/Addlocation.asp"
    xmlReq = xmlReq & "&locationname=" & request.form("Naam")
    xmlReq = xmlReq & "&street=" & request.form("Straatnaam")
    xmlReq = xmlReq & "&housenr=" & request.form("Huisnummer")
    xmlReq = xmlReq & "&postcode=" & request.form("Postcode")
    xmlReq = xmlReq & "&city=" & request.form("City")
    xmlReq = xmlReq & "&phone=" & request.form("Telefoon")
    xmlReq = xmlReq & "&fax=" & request.form("Fax")
    xmlReq = xmlReq & "&internet=" & request.form("Website")
    xmlReq = xmlReq & "&email=" & request.form("sEmail")
    xmlReq = xmlReq & "&memo=" & request.form("Memo")
    xmlReq = xmlReq & "&properties=" & request.form("Eigenschappen")

    set xmlObj = getXMLDocument(xmlReq)

    set colLocation = xmlObj.getElementsByTagName("location")
    Set firstLocation = colLocation.Item(0)
    locationid = firstLocation.getAttribute("id")
if xmlObj is Nothing or Not IsObject(xmlObj) then
        exit sub
    end if
end sub

and at the end of the class i have a function:

function Savedata()

lSQL = " INSERT INTO tblLocations "&_
                " (Location_id, "&_
                " locationname, "&_
                " street, "&_
                " housenr, "&_
                " postcode, "&_
                " city, "&_
                " phone, "&_
                " fax, "&_
                " email, "&_
                " internet, "&_
                " properties, "&_
                " X, "&_
                " Y, "&_
                " marker_id, "&_
                " status, "&_
                " Publish, "&_
                " RefID, "&_
                " Memo, "&_
                " TimeStamp, "&_
                " UserStamp) "&_
                " VALUES "&_
                " ('" &objDB.cv(locationid) &"'," &_
                " '" &objDB.cv(Naam) &"'," &_
                " '" &objDB.cv(Straatnaam) &"'," &_
                " '" &objDB.cv(Huisnummer) &"'," &_
                " '" &objDB.cv(Postcode) &"'," &_
                " '" &objDB.cv(City) &"'," &_
                " '" &objDB.cv(Telefoon) &"'," &_
                " '" &objDB.cv(Fax) &"'," &_
                " '" &objDB.cv(sEmail) &"'," &_
                " '" &objDB.cv(Website) &"'," &_
                " '" &objDB.cv(Eigenschappen) &"'," &_
                " '" &objDB.cv(X) &"'," &_
                " '" &objDB.cv(Y) &"'," &_
                " '" &objDB.cv(Marker) &"'," &_
                " '" &objDB.cv(status) &"'," &_
                " '" &objDB.cv(Publish) &"'," &_
                " '" &objDB.cv(RefID) &"'," &_
                " '" &objDB.cv(Memo) &"'," &_
                " '" &objDB.cv(now()) &"'," &_
                " '" &objDB.cv(Session("UserID")) &"')"

                objDB.insert(lSQL)
end function

i hope you can help me with this. i hope i can declare it globally so i can use it in the form as much as i like.

thanks


joefawcett June 8th, 2007 10:21 AM

So how is objDB populated?

--

Joe (Microsoft MVP - XML)

mrjoka June 8th, 2007 10:27 AM

it is in an include, all the connection with the database is maintained in the include, all the fields inserted without a problem except for locationid.

any idea what might be?

thanks for your time.


joefawcett June 8th, 2007 10:34 AM

It's like pulling teeth...
What is objDB.cv? Why should locationId have a value within SaveData?
From within SaveData do a Response.Write of locationId and objDB.cv(locationId).

--

Joe (Microsoft MVP - XML)

mrjoka June 8th, 2007 10:48 AM

i found the error, it seems that value has been overwrite somewhere, it was declared more that once, i did fix it and now it's working good.
thank you for the help and have a nice week end

thanks



All times are GMT -4. The time now is 09:38 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.