Getting around a restricted connection from an external computer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ian Davies

    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

    [color=blue]
    >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[/color]
    be[color=blue]
    >able 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[/color]

    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(Vali dateInputString (Request.QueryS tring("ShowTitl e"),"")) & "," &
    LikePhrase(Vali dateInputString (Request.QueryS tring("ShowDate s"),"")))
    rs.Save Response: rs.Close: Set rs = Nothing: cn.Close: Set cn = Nothing%>

    VB app:

    Public Function GetOnlineEntrie s(ByRef sURL As String) As Variant

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

    End Function

    mURL = "http://" & frmMain.IP_Main & "/getonlineentrie s.asp?ShowTitle =" &
    URLEncode(frmMa in.ShowTitle) & "&ShowDates =" & URLEncode(frmMa in.ShowDates)
    Dim moe: moe = GetOnlineEntrie s(mURL)
    mbOnlineEntries = IsArray(moe)



  • Stefan Berglund

    #2
    Re: Getting around a restricted connection from an external computer

    On Thu, 27 Oct 2005 12:29:10 GMT, "Ian Davies" <iandan.dav@vir gin.net> wrote:
    in <qK38f.11737$Ce 5.6862@newsfe1-gui.ntli.net>
    [color=blue]
    >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[/color]

    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

    Comment

    • steve

      #3
      Re: Getting around a restricted connection from an external computer

      | 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...b ut a direct translation is not one
      i'm going to afford now.

      hth,

      me


      Comment

      Working...