Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Tricky: ASP and Remote SQL Access
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tricky: ASP and Remote SQL Access

 Post Reply Post Reply
Author
Stevo View Drop Down
Newbie
Newbie
Avatar

Joined: 11 November 2002
Location: Australia
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stevo Quote  Post ReplyReply Direct Link To This Post Topic: Tricky: ASP and Remote SQL Access
    Posted: 20 May 2003 at 10:30pm

Hello All,

Have a bit of a tricky one here, and wondering if anyone could help me out.  The problem involves allowing my ISP hosted ASP 3.0 pages to access and internal SQL server database.  Does anyone know how this can best (if at all) be done?

From wat we have come up with, there are two possible solutions:

1. Configure our firewall so that only our ISP can get through on SQL port to query, but that does not provide enough security as SQL level access will send passwords in clear text (not acceptable for required security level), and this may at the same time expose our production database.
2. Create some kind of Web service (an ASP page) that locally queries the database, and have our external ASP page query the internal page (is this even possible?).  This would allow for the only opening up ports from our ISPs IP to our webserver for HTTP traffic. (Again, hosting the actual external page ourselves is not an option due to bandwidth considerations).

The second idea seems preferable, but i have no idea how i'd go about it.  Any ideas?  Any help or advice on either of the above two options (or in general) would be greatly appreciated, as i know it would be very difficult to not know more than i do!!

Many Thanks,
Steve
Confused

Back to Top
Stevo View Drop Down
Newbie
Newbie
Avatar

Joined: 11 November 2002
Location: Australia
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stevo Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2003 at 8:21pm

Does anyone have any ideas?  Help me pleeeeaasssee!!!

Steve

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2003 at 12:47pm

microsoft http xml can open up pages on remote servers and get the output page into a variable:


<%
GotothisURL = "The url to go to"

Set GetConnection = CreateObject("Microsoft.XMLHTTP")

GetConnection.Open "get", GotothisURL, False
on error resume next
GetConnection.Send

output = GetConnection.responseText

response.write(output)
Set GetConnection = Nothing
%>

Back to Top
Stevo View Drop Down
Newbie
Newbie
Avatar

Joined: 11 November 2002
Location: Australia
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote Stevo Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2003 at 7:51pm

Thanks Mart,

That is definitely a good start.  Im not 100% sure i have my brain around it, thats all.  Does such a method allow me to both Query and perform simple changes on an SQL database?  Also, is there anyway to secure this to stop anyone from connecting to our server and running these pages, etc?  Does this mean that actual access of database along with the user interaction, etc, is performed on an internal page, and the external page just acts as a container or shell? Finally, does this mean that all functionality is restricted to that contained in the internal page, or can the external page also host interactive functionality?

Many thanks to anyone with more help,

Regards,
Steve
Smile

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2003 at 3:23am

That would make the external page connect to the internal page and run it. you could give it some functionality using the querystring:

<%
GotothisURL = "http://host.com/deletefromdb.asp?ID=" & request.querystring("ID")

Set GetConnection = CreateObject("Microsoft.XMLHTTP")

GetConnection.Open "get", GotothisURL, False
on error resume next
GetConnection.Send

output = GetConnection.responseText

response.write(output)
Set GetConnection = Nothing
%>

To stop other sites from doing this put this script at the top of your page:

<%
dim ref
ref=request.serverVariables("HTTP_REFERER")

if not ref="The page you want to be able to do this e.g.http://isp.com/delete.asp" Then
response.end
End If
%>

That would send a blank page to other sites/scripts that tried to use this method.

P.s Micorosoft http xml lets the server process the asp script before so it will allow you to Query and perform simple changes.

Martin.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.