Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old June 8th, 2007, 09:41 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

  #12 (permalink)  
Old June 8th, 2007, 10:21 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

So how is objDB populated?

--

Joe (Microsoft MVP - XML)
  #13 (permalink)  
Old June 8th, 2007, 10:27 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

  #14 (permalink)  
Old June 8th, 2007, 10:34 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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)
  #15 (permalink)  
Old June 8th, 2007, 10:48 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in reading xml database balaguru XML 0 May 29th, 2007 02:41 AM
reading a XML file connect2sandep XML 1 December 14th, 2006 04:50 AM
reading a XML file connect2sandep General .NET 0 December 13th, 2006 02:10 PM
Reading XML evidica C# 0 July 25th, 2006 10:33 AM
Reading XML from ASP texasraven Classic ASP XML 2 February 26th, 2004 03:26 PM





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