Solved

How to Post Large Form Data (Hidden Field)

Posted on 2002-06-25
47
1,785 Views
Last Modified: 2007-12-19
Environment: IIS 5.0, asp.dll, Win2k, VB, COM, SQL Server 2k

Requirements: To enable clients, via automation, to update their database from our database without leaving a footprint.

Solution 1: Wrap the data in XML, sent in a hidden form field, so any client can update their database no matter what flavor of technology they use. Make a request for data and get the data back either in a browser or in a script file. Alot of the use will not be by humans but by servers. The .NET Framework does alot of this, but that is not an option at this point. Using a Form to submit the XML data seems like a good solution.
Details: I am using an OnLoad event in an HTML Form to post data. I pack a hidden field with an xml string and post the data: 1. to a script file that handles it from there. OR 2. to the browser

Error: This solution has size limitations (around 300k/3000 bytes). If the data is not greater than this amount the solutions runs without errors. When the data is greater than this, it fails.

Notes: Objects could be created (on the client site) to handle the reception of data, but require costly support, a Microsoft OS, among other items and therefore is not an option. What technology is used for Microsoft's 'Response' object, specifically when you do a 'Response.Write' to a browser; is this Posted Form Data? Is there a size limit on Form Posted Data? Technically I could just print out the same data packed in the string to my browser either XML or non-XML format and it works. The issue is with the Form Posted Data.

Possible Solutions:
1. CDONTS
Notes: Pack the XML in a NewMail object or as an attachment, then email it.
Good: Little implementation overhead, fast development
Bad: One more piece of technology added that can fail, not as clean so clients will be turned off, the client will need an email address, therefore leaving a footprint

2. Getting this one to work!

EE says 200 points is hard, so i give this one 400. I will award the points to anyone with a solution or anyone who posts something that aids in finding a solution.

Cheers!
0
Comment
Question by:rdmjrb
  • 20
  • 11
  • 6
  • +4
47 Comments
 
LVL 18

Expert Comment

by:mgfranz
Comment Utility
Can't you just create a session variable out of the data string?

How about using GetChunks() to post the data... I guess I'm not following what you are doing...
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
Look at these two links. It will give you some idea.
http://www.aspalliance.com/yusuf/article02.asp
http://www.aspalliance.com/Yusuf/Article03.asp

I am with mgfranz, why not use ADO getchunk,appendchunk. With any damn technics you will defintely have issues with very large data. File upload/download, CDO, XML everything would be slower/might break in between with very large data. But in the past I have worked with ADO Getchunk/appenchunk with SQL text field and it worked very well. I even stored large Crystal reports in a text field without any problems. Of course I had performance issues. Therefore I developed a small VB Client-server application to do Upsizing/downsizing.
My suggestion is to build a separate stand alone apps in VB to do those transfers. If more than 300k is a issue, do not waste time how to do it with all ASP technolgies, instead go back couple of years back and give them a tool which will do the job.
Right now I run a batch everynight to upload 30,000 rows from one db to another and I have a VB script scheduled in windows NT.
So one idea is : You can write a VB program which will read the files from the specified directory and update the you SQL db text columns (appenchunk) and the location,name of the file will be updated by your user from your web apps.
How does it sound ?
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
>>Can't you just create a session variable out of the data string?

Yes, but my issue is not getting the data into an object.

>>I am with mgfranz, why not use ADO getchunk,appendchunk.

Again, I can use alot of techniques/technologies on IIS 5.0 to deal with data, however this is not my issue.

>>My suggestion is to build a separate stand alone apps...

Yes but that qualifies as a footprint.

At this point I'm looking for 3 things:
1. A solution using the technologies implemented, which again is: Posting (POST method of HTTP) the XML data in a hidden form field to the client URL (client browser) or to client server (some script or code to handle parsing the xml or doing whatever they want with it)

2. A "fresh look" method/solution I haven't thought of; such as using CDONTS to handle getting the large data across the wire, even though a small footprint is there (in the form of an email address that will receive the attached file or a plain email containing the data).

3. Speed. It is critical that a solution is drawn/proven in a small window of time. The alternative is hardly attractive but is proven (in the form of FTP access, which also leaves a small footprint but has backing and will be used without any other alternatives in sight).

To give you an idea of what i'm looking at:
1. In order to mimmick the error i see, i made 2 files.
a. post.asp - which uses some server-side asp (for i to 1000 next loop) that just builds a large piece of data (var = "string" then inside the loop:var = var + var) to post (post_accept.asp) in a hidden form field. So im just making 'var' this huge piece of data that contains 'stringstringstring...' and sending it over to the next page via a form post. The exact same method that bombs if the data is to big.
b. post_accept.asp - just grabs the data via the querystring (or hidden field) and writes it out.

This application bombs as well when i do too many loops. 30 works fine, but anything after 50 seems to bomb. I want to find the exact amount of data (bytes) that I can send. Once i establish this, i can test it and prove my theory, (that this method (FORM POST) can only handle x amount of data, which i have yet to be able to locate on the web) and i can move on accordingly. This should be quick/easy to do. Thats also why i want to know what underlying technology Microsoft's Write method of the Response object uses. The session object uses the underlying memory cookie to persist data. This way i can go straight to the source and not deal with the (although extremely deep and useful) marketing and scattered microsoft texts.
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
>> Thats also why i want to know what underlying technology

>>The session object uses the underlying memory cookie to persist data.

Sorry to confuse. This was an example of underlying technology.

I've seen both of you guys come up with great solutions for alot of developers, but your thinking too hard on this one. This is nothing special. I'm just dealing with some limitations of the underlying technology (i think) and i'm looking for other minds to wrap around this. The code is only on my side:
<asp file>
<%
obj = xmlData
cliURL = URLstring
%>
<html>
<javascript>
function pageInit()
  submit()
</script>
<body onload=pageInit()>
<form action=<%=URLstring%>>
<hidden field value=<%=xmlData%>>
</form>
<body>
</html>
</asp file>

Thats it. So, you see its simplicity. Like i said, the action of the form can either be a browser, or a script. It's not in my scope to deal with what the clients do with this data, but the data doesnt even make it if its too large and this is why we are here right now :)

Cheers!
0
 
LVL 18

Expert Comment

by:mgfranz
Comment Utility
Right, form data has it's limitations.  Thats not even taking into concideration the special characters that might get passed...

You are going to have to make some sacrafices somewhere, that's how war goes...
0
 
LVL 9

Expert Comment

by:AlfaNoMore
Comment Utility
BUT.... you want to send data from your database to your clients database, so surely finding a web-based way of doing this isn't going to work anyway? How are you giving the data to the client?

You've mentioned sending it to them, but if they're not using an IP address that your server can see, then this won't be possible. You certainly can't post form data to them in an XML data type, unless they have an API that will accept that data and use it, so why not just display it on the screen, and let them save it direct?

Or, if they have a server that you can contact, try the FTP method.

Or, instead of thinking in a way that your server has to send data to them, why not create a VB EXE that they install, and this will use the MSXML2.ServerXMLHTTP on there machine (you may need to include this within the package), and get their machine to put in a request to your server. It just generates the XML for them, they collect it, and they then have it at hand to do things with???
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
I'm not in the market for sacrifices and your VB EXE is a great idea but how is this not a footprint...

Maybe I am not making this clear or maybe you have not read the question fully or need more clarification. Either way I've posted a large amount of details and am not seeing anything resembling a solution. ( It's ok to respond with a question - better than assumption)

Cheers!
Awaiting Experts
0
 
LVL 18

Expert Comment

by:mgfranz
Comment Utility
Why the restriction on "leaving a footprint"?  Besides, ASP is not going to be able to parse data from your database, package it in a way it can be transfered to the client, then uploaded to the client database, (client or server, it doesn't matter...).  You will HAVE to have something installed, ActiveX component, on the client, this could be a MAJOR security hole if it was possible.  

My only other thought would be to use a peer-to-peer solution, but this would still require a client side application.

Again, SOMETHING will have to give, security is my primary concern here...
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
Am I missing soemthing ? You said
>>This application bombs as well when i do too many loops. 30 works fine, but anything after 50 seems to bomb.

So if this is the most important factor, just like I told you before, forget about XML,POST,HIDDEN FIELD etc etc. Now you can have two more options 1.CDO 2. File Upload. CDO could be a better option than Upload, but still not very reliable across the network.
Thats the reason I want to go with some client server EXE's
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
Firstly you say there is a size limitation of around 3k which sounds to me as though you have no method defined on the form tag or have specified GET. Certainly IIS has problems at around this figure when a GET is used. If this is the case then use a POST instead which can certainly take more than 3k. (You also mention grabing the data from the querystring, well this is only populated on a GET).

So far as what technology is being used by response.write. Well simply this is a method to write data to the body section of an HTTP response message. (A form I might point out does the same thing but the direction is different, ie its data is inserted as part of the body of a HTTP request).

There is no theoretical limit to the amount of data that can be written although in practical terms memory consumption on the client tends to be the limiting factor.

Your question is somewhat confused because you seem to be suggesting that you can Post data to a browser. Basically you can't. A post is a request method of HTTP a request can opnly come from a client. The server can only send responses to that request.

I'm presuming that what you are actually trying to do is generate a page with a hidden field containing the data that want to exchange. And then posting this to another server for processing onto the database.

Without using the hidden field idea I can't see how you can do this with HTTP, without some other component. Simply because the response has no other mechanism of transfering data except as part of the response body and a browser will only be able to transfer something that is within a field.

Can I suggest that you post the test code that you already have and let us see what exactly is going on.

Steve
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
Bumped the points (+200) to gather interest.

>>Why the restriction on "leaving a footprint"?

Many reasons, just think about trying to maintain code and or data on thousands of clients and all of their servers around the world :)

>>size limitation of around 3k

read: 300k

>>Well simply this is a method to write data to the body section...

I'm not looking for theories, however I'm in need of detailed technical specs, I know alot of theories and concepts but they only go so far as to delivering a solution.

>>practical terms memory consumption on the client tends to be the limiting factor

I have no concerns of this.

>>Your question is somewhat confused...

Yes it sounds very confusing but at the basic level its HTML 101.

>>I'm presuming that what you are actually trying to do is generate a page with a hidden field containing the data that want to exchange.

True, however if I knew that it was on this side (creating the form or data to send) it was breaking then my question would be focused on this.

>>And then posting this to another server for processing onto the database.

True as well, however my "page" never arrives because of the issue.

>>Can I suggest that you post the test code...

Yes, I did post psuedo code in a previous post, but will post some code you can copy/paste.

========================================
index.asp - building data to pack in the hidden field to send along. Run this code and view the results, then change this 'FOR i = 1 TO 5' to 'FOR i = 1 TO 50' and watch it break.
========================================
<%@ Language=VBScript %>
<%
OPTION EXPLICIT
Server.ScriptTimeout = 100

DIM postDataCS, i
postDataCS = "data"
i = 1
FOR i = 1 TO 5
     postDataCS = postDataCS + postDataCS
     i = i + 1
NEXT
%>
<HTML>
<HEAD>
<TITLE>PostCS</TITLE>
<SCRIPT LANGUAGE=javascript>
<!--
function initPage() {
     document.forms[0].submit()
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR='#FFFFFF' onLoad='initPage()'>
<FORM NAME="postCS" ID="postCS" METHOD="POST" ACTION="post_accept.asp">
<INPUT TYPE="HIDDEN" name="postDataCS" ID="postDataCS" VALUE="<%=postDataCS%>">
</FORM>
</BODY>
</HTML>

========================================
post_accept.asp - grab the data and display it
========================================

<%@ Language=VBScript %>
<%
OPTION EXPLICIT

DIM postDataCS
'postDataCS = Request("postDataCS")
postDataCS = Request.QueryString("postDataCS")
%>
<HTML>
<HEAD>
<TITLE>PostAcceptCS</TITLE>
<SCRIPT LANGUAGE=javascript>
<!--
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR='#FFFFFF'>
QueryString = <%=postDataCS%>
ALL_HTTP server variable =
<%= Request.ServerVariables("ALL_HTTP") %> <BR>
CONTENT_LENGTH server variable =
<%= Request.ServerVariables("CONTENT_LENGTH") %> <BR>
CONTENT_TYPE server variable =
<%= Request.ServerVariables("CONTENT_TYPE") %> <BR>
QUERY_STRING server variable =
<%= Request.ServerVariables("QUERY_STRING") %> <BR>
SERVER_SOFTWARE server variable =
<%= Request.ServerVariables("SERVER_SOFTWARE") %> <BR>
</BODY>
</HTML>
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
>>You cannot exceed 500 points for any single question.

To anyone who gets this I will send them another 100 points to get around the EE point restriction.
0
 
LVL 18

Expert Comment

by:mgfranz
Comment Utility
You are not going to be able to POST data strings over 64K, period, maybe you should look into Content-Disposition as an option.
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
>>You are not going to be able to POST data strings over 64K

How do you know, can you site a reference or something?

>>look into Content-Disposition

Can you pls explain this in greater detail?
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
>>You are not going to be able to POST data strings over 64K

How do you know, can you site a reference or something?

>>look into Content-Disposition

Can you pls explain this in greater detail?
0
 
LVL 18

Expert Comment

by:mgfranz
Comment Utility
Because I know... I have been doing this stuff for a LONG time, somethings you just know.  In fact, I believe the current limitation of most servers is 32K.

Content-Disposition is a method that will allow the user to download a file onto their machine, they will still have to run some sort of code to update the dB.

There is no opportunity for a two-way "conversation", exchanging data, as normally happens with application programs running on a single host, or over other forms of network communication. This, in general, is one of the limitations of the HTTP protocol.

I think what you are asking is not possible.
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
>>Because I know...

I do believe you but if you have any references please site them.

>>...allow the user to download ...

Like i said, the most likely scenario will have zero human interaction. The client will setup some script (asp or other) that will most likely be run nightly and will simply send my server a request, to a specific asp file, this file will handle getting the data, creating the well formed xml data, packing it into the form and sending the response back.

>>I think what you are asking is not possible.

It is and its working. It's similar to an RPC type functionality, its just the size limitations I'm dealing with.

If you're saying its 32k then this makes sense to me because this is around where the application fails. I'm just looking for greater details.
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
>>>Well simply this is a method to write data to the body section...

>>I'm not looking for theories, however I'm in need of detailed technical specs, I know alot of theories and concepts but they only go so far as to delivering a solution.

Well it was fact but you obviously don't understand the theories/protocols otherwise you wouldn't ask the question.


>>>practical terms memory consumption on the client tends to be the limiting factor

>I have no concerns of this.

Well you should have because it won't bl**dy work otherwise.

>>>I'm presuming that what you are actually trying to do is generate a page with a hidden field containing the data that want to exchange.

>True, however if I knew that it was on this side (creating the form or data to send) it was breaking then my question would be focused on this.

>>>And then posting this to another server for processing onto the database.

>True as well, however my "page" never arrives because of the issue.

Read what I said. What you are trying to do with the protocols that you want to use can not be done.

>>>Why the restriction on "leaving a footprint"?

>Many reasons, just think about trying to maintain code and or data on thousands of clients and all of their servers around the world

Then if it is so important you do it properly and do not try and cobble a solution together.


0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
>>mouatts

I'm just looking for technical details and nothing else.

>>>Well simply this is a method to write data to the body section...

Do you know it specifically or not.
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
Yes.

The response object maps onto the HTTP response message.

There are a number of methods that allow you to manipulate the HTTP header and then you have the write method that outputs the HTTP response body.

In theory response.write is just outputing data and you might be able to use it to output parts of the head section but this makes assumptions about the underlying functionality of the response object and is therefore inadvisable.

A second method also exists for outputing to the body section which  is binarywrite. Typically this is used when outputing binary mime-types such as images and also if you were to construct a multipart HTTP message. However I'm not sure that this will really help your situation.

Basically yes you can output from the server large HTTP messages the obvious example being a large image. There is no theoretical limit to the size of these messages, however there are practical limits.

What those practical limits are depends on a number of factors but in particular how the receiveing application has to deal with them.

With HTML the browser has to essentially load in all of the HTML to render the page and even though it is not actually going to display a hidden field it still needs to be there as part of the rendering process. Because the page and in particular the individual component (ie hidden field) have to be manipulated as a whole it forces a limitation on us.

With many other mime types such as word documents and PDFs the browser can write these to temporary files and then rely on the helper application (Word, Acobat etc) ability to read its data from files in chunks. Hence the size limitation is much greater.

Neither HTTP nor browsers are designed for the transfer of large volumes of information so if you try and do it this way you are likely to hit on problems. Prehaps more importantly it does not provide you with the feedback mechanisms to ensure data integrity. By that I mean if you could get the whole thing to work you have no way of determining if the final HTTP request to the target machine has worked or not. Even though from the client end you might detect that things appear to not have worked you would not know if it was the request that had failed on the response. Hence you target database may or may not have been updated as a result of a failed transaction.

This seems to me a great way to loose data integrity.

Frankly FTP seems a much better protocol to use for transfer.

Steve
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
Findings:

1. Huge amounts of data (no matter what its form) can be served across the wire from an internet server (iis 5.0 in my case).

2. The underlying technology is the actual wires, then TCP/IP, above that is URI(L) and HTTP and then the web servers and browsers come in using all of these.

3. A part of the HTTP spec is the form. Form submission can be used in a RPC style programming model where a client (browser (computer/wireless device)/server) makes a call to a server script/page, the server processes the request (ASP, COM, ETC.), packs an answer into a form and then submits the form to a specified URL or dynamic location. The nature of the form and the technology to manipulate them (client/server side scripting) enables this activity.

4. The "huge amounts of data" (1.) do not use the form to transfer this data. A submitted form can only handle 32k of data.

5. The file upload is the exception. File uploads use forms technology and transmit huge amounts of data. So how is a form able to transmit more then 32k of data in this case and not in others?
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
1) Yes so long as the correct protocols are used.

2) well actually the URL is really part of IP which sits below TCP. The layers in ISO model terms are (on the client)

Physical - twisted pair cable
Data Link - Ethernet
Network - IP
Transport - TCP
Session - HTTP
Presentation - HTML
Application - Browser

On the server the presentation layer is CGI and the Application layer is your ASP program etc.

3) No a form is part of the HTML spec. But otherwise thats the gist of it except the server sends back HTML that just so happens to contain a form. It doesn't send a form back however the distinction I'll explain in 5.

4) There are a number of limiting factors but no hard figure. IE may be limited to 32k but other things could reduce this further.

5)Because on an upload a different encoding method is used namely ENCTYPE="multipart/form-data". In this case the HTTP message contains multiple body sections.

Now whilst a server can accept this at the HTTP/CGI level you do need to process such a request differently to a more conventional form.

Obviously you can send large volumes of data back to the client as well, and in doing this another multipart encoding type may well be used. Whilst the client again will understand this at the HTTP level at the Browser level it can only really deal with these as a file download or as a resouce like an image or audio file.

You can't send a multipart/form back to a client because as I said in 3) browsers do not accept forms only HTML.

HTH
Steve
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
Steve: thanks for the details. I'm still sitting without a solution and I'm very limited to time. The only reason this can be a cobble is because everything I did by hand, the .NET framework does automagically.

Can you look at the original posts and what do you think?

I'm also looking at the HTTP object, so I would write the file to the server and rather then pass the xml through the hidden field I would pass the name of the file and then use the HTTP object to locate and spit back to the client. However, even if i do that it is sent as html and not xml.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Expert Comment

by:mouatts
Comment Utility
Ok just looking at what you are trying to do. Lets assume that you can extract the data fro the source databases using an http call eg www.domain1.com/extractdata.asp
and you can add it to your target database with www.domain2.com/insertdata.asp

As I see it the problem with this scenario isn't HTTP but the browser.

So the approach that I think I might use is to write a progam that utilises HTTP but effectively acts as the browser ie is the Application level.

This is not as differcult as it might sound. Basically all it needs to do is to is open a socket to port 80 on domain1.com and send the request. It can then read all the data that is returned.

Once it gets the data it can either update the target database directly (if it has access to the database) or split the data into chunks and call inserdata.asp for each chunk (again by opening a socket to port 80 on domain2.com).

As you program will be controlling all the data it doesn't need to be in HTML or even XML format. You can chose a format that is most easily processed by your program.

The data its self will be passed simply as part of the response body from extractdata.asp

Steve
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
Ok. Can you give me an example of how to code/configure this?

The most important thing is automation and from your example 'insertdata.asp' is sitting on the client's webserver, which means we have to put a script there, which means it isn't automated.

I understand where you're going (sort of) with this but technically I'm not sure where I would start. In context of the current solution, where we give the client a web address, which they then can hit from a browser or use that address in a script file (they create) which then sends us a request, we get the data, make it xml and then sends the response back. As you know, this solution uses FORM submission to "automate" the process but is limited in the size of response.

In this context how would your solution be built?

In a previous application I sent a request to a server:port (http://server/script.asp?username=me:80) and the response was a private chat with the user sent in the query string. Is your application like this?

I like where you're headed and just need more details to get going.
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
Automation means something being run without human intervention. Placing a script on a server doesn't mean that it isn't automated the two are unrelated concepts.

As to how to build it. Well in a way you have already done it in that you have a routine that output a lot of data (using a form) well the principle is the same. Remember the issue with sizze isn't the amount of data that can be output but the amount of data that can be handles by the browser. As we are talking the browser out of the equation this issue is resolved.

Without knowing extactly what you are trying to do I can only give you a rough example.

extractdata.asp (fragment)
---------------------------

sql="SELECT * FROM MAINTABLE"
set res=connection.execute(sql)
WHILE NOT res.EOF
    for each field in res.fields
        response.write(CHR(34)&field.value&CHR(34)&","
    next
    reponse.write(vbcr)
WEND


So the output from this might look as follows
"1","SMITH","JOHN","23-jan-1961"
"2","BLOGGS","FRED","25-may-1990"

etc

insertdata.asp (fragment)
-------------------------
sql="insert into maintable (record_id, surname, first_name, dob) values ("&request(record_id")&",'"&request("surname")&"','"&request("first_name")&"',#"&request("don")&"#)"
connection.execute(sql)


I'm not going to write the intermediate process because quite frankly I don't have the time at present. BUt I would use a component called ASPSOCK and write it as a Windows Scripting Host program.

Essentially you have to connect the socket and once a connection has been raised sent the http header which will be "GET extractdata.asp HTTP/1.0"

You the need to read the returned message.
Each returned line will consist of a header message until you come to a line that consists simply of a CRLF. This then signifies the start of the body.

Each line of the body wiol be as described above which you can the decode into the URL required to call insertdata.asp
(eg insert_date.asp?record_id=1&surname=bloggs&firstname=fred

You fire this off by opening another socket but top the target server in the same way as you fired off the extraction.

HTH
steve
0
 
LVL 18

Expert Comment

by:mgfranz
Comment Utility
This thread is still open?  Nice...

Good luck Steve, I'm outta here.
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
Ok, point taken, however I cant rely on placing a script on the client's server. The only thing I "give" the client is an internet address, the rest is up to them.

As far as the rest, we are getting somewhere but It's the intermediate process that I need, I have the data (xml) all ready to go. I don't even worry about SQL INSERT codes or db name or anything, just getting it back. The ASPSOCK and the header stuff is sounding interesting, but I'm still blind as to how to "get" the data there.

I assume ASPSOCK does some socket connections and I can get the data there using this? Can you be more specific?
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
Ok here is the gist. Please remember that ASPSOCK is not a standard component so you will need to obtain it from www.serverobjects.com

FUNCTION GET_PAGE(host,page,header,body)
Set Socket = Server.CreateObject("AspSock.Conn")

Socket.RemoteHost = host
Socket.Port = 80
socket.logfile="d:\socket.log"
line_count=1

IF socket.open THEN
     IF socket.connected THEN
            ' add any additional headers needed here eg
            'socket.writeln("HTTP_HOST:www.mydomain.com)
            socket.writeln("GET "&page&" HTTP/1.0")
         socket.writeln("")
         x=socket.readln
         WHILE x<>""
          redim preserve header(line_count)
          header(line_count)=x
          line_count=line_count+1
          p=INSTR(x,"Content-Length: ")    
          IF p>0 THEN
               p=INSTR(x,":")+1
               content_length=REPLACE(REPLACE(mid(x,p+1),vbLF,""),vbCR,"")
          END IF
          p=INSTR(x,"Content-Type:")
          IF p>0 THEN
               p=INSTR(x,":")+1
               content_type=REPLACE(REPLACE(mid(x,p+1),vbLF,""),vbCR,"")
          END IF
          x=socket.readln
         WEND
            ' you shouldn't need this if content length is output
         IF NOT CLNG(content_length) > 0 THEN
             content_length=200000
         END IF
         body=socket.readbytesasstring(CLNG(content_length))
         GET_PAGE=True
     ELSE
          body="Not connected "&socket.error
          GET_PAGE=false
     END IF
ELSE
     body="Not Opened "&socket.error
     GET_PAGE=false
END IF

END FUNCTION

TO use this function use

dim header()
dim body

res=GET_PAGE("www.mydomain.com", "extractdata.asp", header, body)

On a successful return body will contain the body entity of the http message.

The following function will split the body into an array of lines
FUNCTION SPLIT_BODY(body,body_lines,divider)

     line_count=1
     linep=INSTR(body,divider)
     WHILE linep>0
          redim preserve body_lines(line_count)
          body_lines(line_count-1)=LEFT(body,linep-1)
          line_count=line_count+1
          body=MID(body,linep+1)
          linep=INSTR(body,divider)
     WEND
     IF len(body)>0 THEN
          redim preserve body_lines(line_count)
          body_lines(line_count-1)=body
          line_count=line_count+1
     END IF
     
     SPLIT_BODY=line_count
END FUNCTION

Where body_lines is defined as dim body_lines()

Steve
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
so what wud the 5,000 foot view of a user/client interacting with this application look like? Does the user/client "need" anything from me besides an internet address...do i "need" anything from the user/client besides a clientid passed...

does ms have a comparable free component (winsock sdk) ?
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
>>so what wud the 5,000 foot view of a user/client interacting with this application look like?

I haven't the faintest idea what you're talking about.

>>Does the user/client "need" anything from me besides an internet address...do i "need" anything from the user/client besides a clientid passed...

Where has client suddenly appeared from? We've been talking about source and target servers?



0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
5,000 foot = not a very close >>view of a user/client interacting with this application........

>>Where has client suddenly appeared from?

>>Requirements: To enable clients, via automation, to update their database from our database without leaving a footprint.

based on my last post i am very unclear and am in need of greater definition to understand your application and i ask question to dig around and see if and how it can fit in my solution....im only here to solve my problem and gain expertise advice in some fun and challenging way...not just to upset you :)
0
 
LVL 11

Accepted Solution

by:
mouatts earned 500 total points
Comment Utility
I've explained it as clearly and simply as I can, I've provided example code I don't really see what there is left to say.

Steve
0
 
LVL 9

Expert Comment

by:AlfaNoMore
Comment Utility
LOL...

I can't still believe this is open either?

I think some things need explaining VERY clearly (like they haven't been already!).

YOU have an IIS web server.

Your CLIENTS have a web browser.

There is NO two way interaction between these two things. The Browser asks for something, the server gives it. That's it.

So if you want automation, this has to be actioned by your CLIENTS...

But, if you want to give your CLIENT an internet address, this is fine. They'll have to open a browser window (manually in this case), type in your address, and hit go.

Your SERVER will then generate the XML you want them to have, and display it to them inside their browser. There is no need for a form object here, as you do not need to pass this data around your server. You just need to display it directly to the CLIENT.

And that's it. What your CLIENTS do with that data is then up to them. As you are not wanting to get involved in their side of things, your now out of the loop (although, we all know that won't be the case! They WILL ring you up and ask for some help ;-))

Lots of nice things have been suggested as more professional solutions, but as you're not wanting to get involved in their operations, there really isn't a lot you can do. You just need to produce the XML, and they can then use it....
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
<soapbox>ok-you guys have exhausted me in trying to explain and re-explain and re-explain and bla bla bla. i can imagine someone without my experience coming in here to try and solve an issue similar to mine and how they would get anything to help them. you guys either assume you know everything and everyone else nothing or that you have to go back to kindergarten to explain thing...very sad</soapbox>

if those 5 lines of explanation are "clear and simple" then im in alot of trouble.

<soapbox>it is nice that all of you "experts" get a laugh this thread is still open-my issue is still "open" and unsolved as well and thanks for your help steve and alfanomore and the rest...

next time i will think twice before coming here with a question that may require some extra time and thought and isnt something learned in the first few months of developing asp pages which is the bulk of questions i've seen out here.

its a big world out here and we (technologists) are the ones who in some way are making it bigger and smaller at the same time, its a shame to see ppl with so much potential with such closed minds...good luck to you all</soapbox>
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
A 'C' grade ?
0
 
LVL 9

Expert Comment

by:AlfaNoMore
Comment Utility
It's a shame you weren't able to get a satisfactory answer to your problem, but this happens sometimes. Usually when what you're asking for can't be done (as in this case!!)

Alternatives were suggested (not in much detail, but then they were all dismissed, so no opportunity for detail to be provided.)

I hope you are able to adject your thinking and come up with a workable solution?
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
I feel that I have put a lot of effort into answering this question far more than many would have done. The answer that has been given is complete as it can really be without detailed knowledge of the database etc involved. There is certainly enough for anyone to be getting on to actually solve the problem. To then be rewarded with a C is little short of insulting.

So far as your other rantings are concerned I'll not comment any further but to suggest that you don't have the level of experience you seem to be claiming.

I'll be contacting the moderators to have this adjusted.
0
 
LVL 20

Expert Comment

by:jitganguly
Comment Utility
100% mouatts. and pls also keep a note of this asker. It would have cost couple of hundred dollars for this and on return we want a good appreciation.
Pls inform CS to change it
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
it doesnt take much for me to be satisfied, but i know the difference between a lazy post and one that is technically sound and to the point of the question. rather then assuming you know what im talking about and going forward you can come to first understand what im asking in the first place, then find out what i already know, then move forward with that knowledge.

c = average. i spent more time re-explaining my issue and dealing with side issues then dealing with my original post. (like now)

>>Usually when what you're asking for can't be done (as in this case!!)

It can and is being done.

>>but then they were all dismissed

Not true. I'm dying to talk about possible solutions, but it seems I am alone.

>>and come up with a workable solution?

A solution will be found, but with little help from this thread.

>>I feel that I have put a lot of effort

Your effort was scattered and very off the point. A few posts were dedicated to everything else but finding a solution and trying to dig through this is hardly worth the effort on my part.

>>The answer that has been given is complete as it can really be without detailed knowledge of the database etc involved.

This is not true. It doesnt matter what fields I'm trying to pass, we can hardly get down to the nuts and bolts of this issue, much less trying to see which nut and which bolt go where. Once you can establish a solid understanding on all the parties involved then you can talk details. But as i said we cannot even get to the main point of this thread.

>>To then be rewarded with a C is little short of insulting

When I spend half of my time trying to re-explain the details of a solution and cannot even get you to spend a little more mind power and creativity to help me (and anyone else who purchase this thread in the future) understand what you are posing I think average is not very insulting but only reflects your own lack of enthusiasm for even being here in the first place.

>>suggest that you don't have the level of experience you seem to be claiming.

I'd love to hear how you came to this conclusion...that alone may be worth the 500 points given to you.

>>I'll be contacting the moderators to have this adjusted.

I'd also love to have them look at this mess and I would love to have them tell me there are experts out there who are willing to do what it takes find and get a solution because I'm in doubt.

>>pls also keep a note of this asker.

pls do.

>>It would have cost couple of hundred dollars for this

I'm not sure how you figure this. This is a free site with "volunteers"...

>>on return we want a good appreciation.

You seem to be forgetting that in this situation you are not the client, but I am, and if anyone is to "want a good appreciation" first and foremost its the client.

The bottom line is that if we would have spent half of the time on trying to solve this problem then we did on re-explaining the details already posted and going back and forth about how much each of us thinks we know compared to the other and how we think we are right and wrong then this would have turned out better. But we did not and it did not so we can only go forward and take something from this situation which can be an understanding perception and reality.
0
 

Expert Comment

by:ComTech
Comment Utility
Hello rdmjrb, I don't see a C grade quality here in this queston.  Let's never forget that sometimes a "Can't be done" or"no" are acutally justifiable and gometimes the best answer.

As for your own intrests, most of the Experts will look at your past grading record, and if enough bad grades, many will refrain from participating.  That is something I have no control over.

This grade will be changed,

Regards,

ComTech
Community Support Administrator  
Experts-Exchange  

0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
ComTech:

Your title reads "Support", however based on these actions you do not "Support" the community. This is as far away from "Support" as can be. Change the title or change the actions but the 2 do not go together in this situation.

Please define "grade".

Grade: An accepted level or standard. A number, letter, or symbol indicating a level of accomplishment.

>>I don't see a C grade quality here in this queston

1. How can you "see" anything without communication with the person who asked the question in the first place?
2. Why do "grades" even exist if they have no meaning to the person who is giving the "grade" and can be changed at will and for no apparent reason?
3. How did you come to this conclusion, because simply saying that you dont "see" it isn't enough to gain my respect.
4. What does a C grade quality consist of? (and A and B)
5. The site tells the user they should give 200 points for a "hard" question. Given this, I offered up more than double of that recommendation for numerous reasons all pointing to finding a solution or a greater understanding leading to a solution.
6. What, if anything, do the points have to do with the grading process? If I spend $5-$10,000 on an automobile I dont have much room for complaints because the time spent dealing with any issue is not worth the money in overhead. However, if I spend $20-$30,000 I have significantly more complaining or in this case "grading" power.

I was hardly satisfied to abandon this post in the first place but I was spending too much time re-explaining what had already been posted (in some cases more than once) and time trying to get ppl away from their own assumptions (that could have easily been dealt with the way most ppl deal with something they dont understand or are not sure: asking a question) and time spending dealing with issues (like this) that dont even matter to assist me in solving a problem i have using active server pages to solve my client's problems and may in turn help solve someone else's problems because someone put the time and energy to build this forum for this type of interaction to happen...too much time doing everything but what the purpose of even being here is.
 
>>Let's never forget that sometimes a "Can't be done" or"no" are acutally justifiable and gometimes the best answer.

What an arrogant and condescending statement. This is perfectly understood, however this is not the case in this question so it cannot be used as an example with respect to this question.

>>As for your own intrests, most of the Experts will look at your past grading record...

Understood and my grades are fair. (and by the way are nothing other than A's, including this one since it has now been "changed" (read: "supported"), and has been the only one "changed") (and by the way i have been an "expert" out here and really dont care of ppl's past grading scores...im not here to get points and receive grades...but to use my experience to help other ppl in their inexperience and to contribute to the technology community)

>>That is something I have no control over.

Next sentance: >>This grade will be changed
Enough said.

This site has alot of potential, however it hardly deserves an "experts" in the title and doubt if it will keep the attention of any true "experts" or quality users for any period of time for reasons bleedingly apparent in this thread. This has not been an "Experts-Exchange" but rather an exchange in attitudes.

Please, for steve's sake, change the grade, but understand i do not respect this descision nor do i think it is even close to being deserved.
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
PS.

>>To anyone who gets this I will send them another 100 points to get around the EE point restriction.

dont hold your breath steve...
0
 
LVL 11

Expert Comment

by:mouatts
Comment Utility
I wasn't. By the way pick the toys up now you have thrown them out of the pram.
0
 

Expert Comment

by:ComTech
Comment Utility
rdmjrb first off you do not have the grading points right. The range is low @ 20 points, and the high is 500 points.

As it is, your comment regarding me, you don't know who I am or what I do, so it boils down to an Opinion .  And I am resoning that you already know what the means.

Water off a ducks back.  : >

CT
ROFL : >

btw-if the answer was not what you wanted, then why did you feel compelled to accept an answer?
0
 
LVL 2

Author Comment

by:rdmjrb
Comment Utility
Can you guys be serious??? Good luck competing in the global economy with these childish and ridiculous attitudes!!! (read: ego's)

>>why did you feel compelled to accept an answer?

Have you ever heard the phrase "beating a dead horse"? I dedicated paragraphs to "why i felt compelled" ....because it was worse than dead and definately not going anywhere...and if i was to have an answer or much less a conversation relating to my problem and need then it would have been happening. But only sly remarks, confused assumptions and complaints wasting time seemed to be the focus.

Its a shame that you had a chance to represent EE in some positive way and this is your choice of how to use your position, energy and time. You dealt with only 1 of many detailed points I brought forward and not even in a way which is easy to understand and comprehend given the scattered and haphazard context and structure of your sentance.

I dont know you or who you are or what you do or where you come from. Frankly I dont care, but what I do care about is positive movement in technology and this forum as a tool. The only way anyone truly knows you is by your actions alone and they are definately speaking louder than your words.

I am glad everyone has got some type of amusement out of this, and if it is any reflection of the "talent" out there solving problems for business using technology, then I am having an even bigger laugh now.

Thanks for nothing and Good luck!
0
 
LVL 9

Expert Comment

by:rg20
Comment Utility
IF you are still here, I think you could use FSO with active x to copy the database entirely to the clients machine.
1. Already active on the clients machine
2. Done behind the scenes
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now