471,045 Members | 950 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,045 software developers and data experts.

Getting around a restricted connection from an external computer

Hello Stefan or anyone else who can help

Some time ago you suggested a solution to my original post about connecting
to data on a remote server from a VB application where my host doesnt allow
a direct external contact. Your solution is below. However my host doesnt
support ASP on the Linux server my site is on. My question is do you know
how to acheive the same thing with php?

Ian

Hello
My host does not allow external connections to my MySQL database on their
server from a remote computer. I would like users of my VB application to beable to add records from a table on said database to their local MySQL
database. Can anyone advise me of my options to solve this one (appart from
changing host)?

Thanks
Ian


Create an ASP that queries the database and saves the recordset to the
response
object. This method assumes the information is encrypted in the db if it's
sensitive.
ASP:
<%Option Explicit%>

<!--#include file="inc/asp_head.asp" -->
<!--#include file="inc/asp_connect.asp" -->
<%Dim rs: Set rs = cn.Execute("get_OnlineEntries " &
LikePhrase(ValidateInputString(Request.QueryString ("ShowTitle"),"")) & "," &
LikePhrase(ValidateInputString(Request.QueryString ("ShowDates"),"")))
rs.Save Response: rs.Close: Set rs = Nothing: cn.Close: Set cn = Nothing%>

VB app:

Public Function GetOnlineEntries(ByRef sURL As String) As Variant

Dim rs As ADODB.Recordset: Set rs = New ADODB.Recordset: rs.Open sURL
If (Not rs.EOF) Then GetOnlineEntries = rs.GetRows: If (Not rs Is Nothing)
Then rs.Close

End Function

mURL = "http://" & frmMain.IP_Main & "/getonlineentries.asp?ShowTitle=" &
URLEncode(frmMain.ShowTitle) & "&ShowDates=" & URLEncode(frmMain.ShowDates)
Dim moe: moe = GetOnlineEntries(mURL)
mbOnlineEntries = IsArray(moe)

Oct 27 '05 #1
2 1704
On Thu, 27 Oct 2005 12:29:10 GMT, "Ian Davies" <ia********@virgin.net> wrote:
in <qK******************@newsfe1-gui.ntli.net>
Hello Stefan or anyone else who can help

Some time ago you suggested a solution to my original post about connecting
to data on a remote server from a VB application where my host doesnt allow
a direct external contact. Your solution is below. However my host doesnt
support ASP on the Linux server my site is on. My question is do you know
how to acheive the same thing with php?

Ian


Hi Ian-

Sorry, I can translate from PHP to ASP but since I don't currently have a Linux
box to test on there's not much I can do to help you. Ask in a PHP forum how to
save a recordset to the response object.

---
Stefan Berglund
Oct 27 '05 #2
| Hi Ian-
|
| Sorry, I can translate from PHP to ASP but since I don't currently have a
Linux
| box to test on there's not much I can do to help you. Ask in a PHP forum
how to
| save a recordset to the response object.
|
| ---
| Stefan Berglund

hey stefan! it's good to see you're still alive and posting vb goodies.

btw, the op not only posted to a php ng but also to every computer related
ng i can think of. ;^)

anyway...from an architectural standpoint when working cross-platform, i'd
recommend using web services to make the data consumable...be it from a
php/asp script, gui app, or a proc run on a cron. at that point, each has
enough information to get/publish/consume the data in a manner appropriate
to its given environment (including language)...and without a bunch of
system-specific caveats along the way.

of course i do have other suggestions...but a direct translation is not one
i'm going to afford now.

hth,

me
Oct 28 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

303 posts views Thread by mike420 | last post: by
4 posts views Thread by Odd Bjørn Andersen | last post: by
8 posts views Thread by Steven D'Aprano | last post: by
41 posts views Thread by LayneMitch via WebmasterKB.com | last post: by
9 posts views Thread by KDawg44 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.