Re: Recommended Approach
From: Don Grover (dgrover_at_assoft.com.au)
Date: 11/11/05
- Next message: Mike Epprecht \(SQL MVP\): "Re: Password History in SQL Server"
- Previous message: Andrew J. Kelly: "Re: Moved database to new server...before creating logins"
- In reply to: Dan Johnson: "Re: Recommended Approach"
- Next in thread: Don Grover: "Re: Recommended Approach"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 12 Nov 2005 07:02:50 +1100
"Dan Johnson" <johnson@milehi.com> wrote in message
news:c1f3d$43749db8$d826dfe9$18764@VIAWEST.NET...
> Thanks Don.
>
> After reading your example, and finding a few examples elsewwhere on the
> net, I'm still trying to find an example (via xmlhttp) where you retrieve
> a
> value from the web sites database (in this case a SQL Server database).
> The
> following is how it would start I think:
>
> set xmlhttp = CreateObject("MSXML2.XMLHTTP")
> xmlhttp.open "GET", url, False
>
> The "url" must be where I would point to a value stored on the web
> page...I
> know how you SEND data to a web page (url followed by ? etc), but how do
> you
> both send data (the customer ID for example), AND get data back (the
> customer's install date)? Then, I guess I need code/script on the web
> page
> requesting the data/recordset from SQL Server, right?
>
> Dan
>
> "Don Grover" <dgrover@assoft.com.au> wrote in message
> news:%23fyV7Lo5FHA.1032@TK2MSFTNGP11.phx.gbl...
>> This working vbscript sample posts to a form and gets a web page, if the
>> webpage form returned just text then that is what you would get.
>> What I would do is get the form to return ***version*** , that way you
> would
>> be able to search string for pattern and extract version info.
>> You could have your vb app pass there lic details in form and do a qry on
> it
>> to return the actual binary file and write to disk.
>>
>> 'vbscript
>>
>> url =
>>
> "http://www.tabracing.com.au/asp/odds.asp?m=37141&e=6&c=&d=22/06/2004&viadro
> pdown=&r="
>> set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
>> xmlhttp.open "POST", url, False
>> xmlhttp.setRequestHeader "Content-Type",
>> "application/x-www-form-urlencoded"
>> xmlhttp.send ""
>> if err.number <> 0 then
>> sUrlReturn ="FAILED"
>> WSCRIPT.ECHO "Nothing Returned"
>> else
>> sUrlReturn = xmlhttp.responseText
>> sUrlReturn = Right(sUrlReturn,Len(sUrlReturn) - (sRetVal
>> +4200) )
>> sUrlReturn = Left(sUrlReturn,LEN(sUrlReturn) -200)
>> WSCRIPT.ECHO sUrlReturn
>> end if
>>
>>
>> "Dan Johnson" <johnson@milehi.com> wrote in message
>> news:dc1c3$4373c490$d826dfe9$5133@VIAWEST.NET...
>> > Thanks for your reply Don.
>> >
>> > Any suggestions for where I can see how an "xmlhttp post " is done?
>> >
>> > Dan
>> >
>> > "Don Grover" <dgrover@assoft.com.au> wrote in message
>> > news:%23CKTgBk5FHA.1140@tk2msftngp13.phx.gbl...
>> >> Not that I have put too much thought into it but here is a possible
>> >> solution.
>> >> Have the vb6 app do a xmlhttp post to your web server and have it do
> the
>> >> request for subscription date.
>> >> Then depending on what is returned you can download an update or not.
>> >>
>> >> Don
>> >>
>> >>
>> >> "Dan Johnson" <johnson@milehi.com> wrote in message
>> >> news:5660$437357ed$d826dfe9$15934@VIAWEST.NET...
>> >> > Our company has a web site hosted by a third party with a connection
> to
>> >> > our
>> >> > SQL Server. The SQL Server resides locally behind the company's
>> > firewall.
>> >> >
>> >> > We write software and would like to have our app (written primarily
> in
>> >> > VB6)
>> >> > occasionally get small amounts of data from our SQL Server. For
>> > example,
>> >> > when the customer/user wants to get the most recent update to our
>> >> > software,
>> >> > we would want to retrieve the effective date of the user's
> subscription
>> > to
>> >> > make sure they qualify for the update.
>> >> >
>> >> > It is my understanding there are two approaches to doing this. One,
> we
>> >> > can
>> >> > make a direct ADO connection from the user's PC to our SQL Server.
>> >> > Two,
>> >> > we
>> >> > could (using RDS???) use our web sites connection to process the
>> >> > data
>> >> > request, and return whatever info to the user's PC.
>> >> >
>> >> > Both alternatives require opening up a port on our firewall to allow
>> >> > SQL
>> >> > access (good, bad, ugly???). I would tend to think that using the
>> >> > first
>> >> > alternative is preferable because it seems more efficient (if we're
>> > going
>> >> > to
>> >> > open up the port, may as well streamline the user's connection as
> much
>> > as
>> >> > possible...).
>> >> >
>> >> > Can anyone point me in the right direction for analysis here? Would
> be
>> >> > greatly appreciated!
>> >> >
>> >> > Thanks
>> >> >
>> >> > Dan
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>
Dan
This is where the value comes back in the script.
sUrlReturn = xmlhttp.responseText
Therfore when you post to the URL (Web Page) the web page would qry the
database and output the customers install date.
Don
- Next message: Mike Epprecht \(SQL MVP\): "Re: Password History in SQL Server"
- Previous message: Andrew J. Kelly: "Re: Moved database to new server...before creating logins"
- In reply to: Dan Johnson: "Re: Recommended Approach"
- Next in thread: Don Grover: "Re: Recommended Approach"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|