-
vb to xml sending data to the server and save it as xml file
Currently i devloping a program through which user can send the data from
the client to the sever i am using vb program as a client
I am not able to save a file on the sever
VB Program
Dim objectSendXMLDOM As New MSXML.DOMFreeThreadedDocument
Dim objXMLHTTP As New MSXML.XMLHTTPRequest
Private Sub cmdAdd_Click()
AddingIntoXmlDom
End Sub
Function AddingIntoXmlDom()
Dim s As String
Dim Name, Address As String
Name = txtName.Text
Address = txtAddress.Text
s = "<?xml version='1.0'?>"
s = s + "<PUBLISHERS>"
s = s + "<PUBLISHER>"
s = s + "<NAME>" & Name & "</NAME>"
s = s + "<ADDRESS>" & Address & "</ADDRESS>"
s = s + "</PUBLISHER>"
s = s + "</PUBLISHERS>"
With objectSendXMLDOM
.async = False
.Load s
.save "http://localhost/x.xml"
End With
With objXMLHTTP
.open "POST", "http://localhost/updatedata.asp", False
.send objectSendXMLDOM
End With
---------------
Asp program
----------------
<%
Set doc = Server.CreateObject("MICROSOFT.XMLDOM")
doc.load(Request)
Set result = Server.CreateObject("MICROSOFT.XMLDOM")
Response.ContentType = "text/xml"
result.save(server.MapPath("x.xml"))
%>
-
Re: vb to xml sending data to the server and save it as xml file
Make sure that the Web server account has write access for the directory in
which you're trying to save the file.
"prasad sawant" <pdsaw@rediffmail.com> wrote in message
news:3aae6c84$1@news.devx.com...
>
> Currently i devloping a program through which user can send the data from
> the client to the sever i am using vb program as a client
>
> I am not able to save a file on the sever
>
> VB Program
> Dim objectSendXMLDOM As New MSXML.DOMFreeThreadedDocument
> Dim objXMLHTTP As New MSXML.XMLHTTPRequest
> Private Sub cmdAdd_Click()
> AddingIntoXmlDom
> End Sub
> Function AddingIntoXmlDom()
> Dim s As String
> Dim Name, Address As String
>
> Name = txtName.Text
> Address = txtAddress.Text
>
> s = "<?xml version='1.0'?>"
> s = s + "<PUBLISHERS>"
> s = s + "<PUBLISHER>"
> s = s + "<NAME>" & Name & "</NAME>"
> s = s + "<ADDRESS>" & Address & "</ADDRESS>"
> s = s + "</PUBLISHER>"
> s = s + "</PUBLISHERS>"
>
> With objectSendXMLDOM
> .async = False
> .Load s
> .save "http://localhost/x.xml"
> End With
>
> With objXMLHTTP
> .open "POST", "http://localhost/updatedata.asp", False
> .send objectSendXMLDOM
> End With
> ---------------
> Asp program
> ----------------
> <%
> Set doc = Server.CreateObject("MICROSOFT.XMLDOM")
> doc.load(Request)
> Set result = Server.CreateObject("MICROSOFT.XMLDOM")
> Response.ContentType = "text/xml"
> result.save(server.MapPath("x.xml"))
> %>
>
>
>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks