DBI::ODBC Remote Login to Server

Discussion in 'Perl Misc' started by Fred Goldberg, Sep 24, 2004.

  1. Novice - So no flames please.

    I have perl script that connects to our Win2000 Server which is running
    MS SQL Server. My data base handle statement is:

    my $dbh = DBI->connect('DBI:ODBC:DB_Name', 'DB_Login', 'DB_PWD') or
    die "Couldn't connect to database: " . DBI->errstr;

    The above works fine in the office from my networked PC. I would like to
    be able to run this program from home via the Internet. I know my
    server's IP address, user_login and user_password.
    1) How can I modify my $dbh to accomodate this?
    2) Do I need to configure "Data Sources (ODBC)" under my login on the
    remote server so it points to "DB_Name"?

    Thanks.
    Fred
    Fred Goldberg, Sep 24, 2004
    #1
    1. Advertising

  2. Fred Goldberg

    Matt Garrish Guest

    "Fred Goldberg" <> wrote in message
    news:Xns956DD566777E8fredackcommcom@216.196.97.142...
    > Novice - So no flames please.
    >
    > I have perl script that connects to our Win2000 Server which is running
    > MS SQL Server. My data base handle statement is:
    >
    > my $dbh = DBI->connect('DBI:ODBC:DB_Name', 'DB_Login', 'DB_PWD') or
    > die "Couldn't connect to database: " . DBI->errstr;
    >
    > The above works fine in the office from my networked PC. I would like to
    > be able to run this program from home via the Internet. I know my
    > server's IP address, user_login and user_password.
    > 1) How can I modify my $dbh to accomodate this?
    > 2) Do I need to configure "Data Sources (ODBC)" under my login on the
    > remote server so it points to "DB_Name"?
    >


    You need to configure a similarly named ODBC source on your home computer
    pointing to the IP of the server with the db. You shouldn't need to change
    the connection string at all.

    Matt
    Matt Garrish, Sep 24, 2004
    #2
    1. Advertising

  3. "Matt Garrish" <> wrote in
    news:63L4d.27574$:

    >
    > "Fred Goldberg" <> wrote in message
    > news:Xns956DD566777E8fredackcommcom@216.196.97.142...
    >> Novice - So no flames please.
    >>
    >> I have perl script that connects to our Win2000 Server which is
    >> running MS SQL Server. My data base handle statement is:
    >>
    >> my $dbh = DBI->connect('DBI:ODBC:DB_Name', 'DB_Login', 'DB_PWD') or
    >> die "Couldn't connect to database: " . DBI->errstr;
    >>
    >> The above works fine in the office from my networked PC. I would like
    >> to be able to run this program from home via the Internet. I know my
    >> server's IP address, user_login and user_password.
    >> 1) How can I modify my $dbh to accomodate this?
    >> 2) Do I need to configure "Data Sources (ODBC)" under my login on the
    >> remote server so it points to "DB_Name"?
    >>

    >
    > You need to configure a similarly named ODBC source on your home
    > computer pointing to the IP of the server with the db. You shouldn't
    > need to change the connection string at all.
    >
    > Matt
    >
    >

    Matt,

    Thanks for the reply. I tried to configure this server but it continually
    fails test. With this IP address, I can log into the server using Remote
    Desktop. I tried configuring ODBC using 3 different logins including
    Administrator. All failed. I also noted that the ODBC configurator does not
    send anything out to the net unless I preceed the IP address with a "//"
    which I do not use in the office.

    So, what is going on here. Is it possible to configue ODBC for a server
    that exists remotely on the Internet as an IP address rather than being
    part of a LAN?

    Fred
    Fred Goldberg, Sep 24, 2004
    #3
  4. Fred Goldberg

    Matt Garrish Guest

    "Fred Goldberg" <> wrote in message
    news:Xns956EB355A5514fredackcommcom@216.196.97.142...
    > "Matt Garrish" <> wrote in
    > news:63L4d.27574$:
    >
    >>
    >> "Fred Goldberg" <> wrote in message
    >> news:Xns956DD566777E8fredackcommcom@216.196.97.142...
    >>> Novice - So no flames please.
    >>>
    >>> I have perl script that connects to our Win2000 Server which is
    >>> running MS SQL Server. My data base handle statement is:
    >>>
    >>> my $dbh = DBI->connect('DBI:ODBC:DB_Name', 'DB_Login', 'DB_PWD') or
    >>> die "Couldn't connect to database: " . DBI->errstr;
    >>>
    >>> The above works fine in the office from my networked PC. I would like
    >>> to be able to run this program from home via the Internet. I know my
    >>> server's IP address, user_login and user_password.
    >>> 1) How can I modify my $dbh to accomodate this?
    >>> 2) Do I need to configure "Data Sources (ODBC)" under my login on the
    >>> remote server so it points to "DB_Name"?
    >>>

    >>
    >> You need to configure a similarly named ODBC source on your home
    >> computer pointing to the IP of the server with the db. You shouldn't
    >> need to change the connection string at all.
    >>

    > Thanks for the reply. I tried to configure this server but it continually
    > fails test. With this IP address, I can log into the server using Remote
    > Desktop. I tried configuring ODBC using 3 different logins including
    > Administrator. All failed. I also noted that the ODBC configurator does
    > not
    > send anything out to the net unless I preceed the IP address with a "//"
    > which I do not use in the office.
    >
    > So, what is going on here. Is it possible to configue ODBC for a server
    > that exists remotely on the Internet as an IP address rather than being
    > part of a LAN?
    >


    I think you need to take this question to a group that deals with MS SQL
    and/or ODBC at this point. I can only tell you (having connected to MS SQL
    servers at work from home) that you shouldn't need to take any extra steps
    when setting up the ODBC source. You might want to check with your database
    administrator and see if he/she has set up IP blocking on the port to
    prevent anyone from connecting to the SQL server from outside your office's
    computers. But that's just a stab in the dark as to the source of the
    problem...

    Matt
    Matt Garrish, Sep 26, 2004
    #4
  5. "Matt Garrish" <> wrote in
    news:uep5d.36906$:

    >
    > "Fred Goldberg" <> wrote in message
    > news:Xns956EB355A5514fredackcommcom@216.196.97.142...
    >> "Matt Garrish" <> wrote in
    >> news:63L4d.27574$:
    >>
    >>>
    >>> "Fred Goldberg" <> wrote in message
    >>> news:Xns956DD566777E8fredackcommcom@216.196.97.142...
    >>>> Novice - So no flames please.
    >>>>
    >>>> I have perl script that connects to our Win2000 Server which is
    >>>> running MS SQL Server. My data base handle statement is:
    >>>>
    >>>> my $dbh = DBI->connect('DBI:ODBC:DB_Name', 'DB_Login', 'DB_PWD') or
    >>>> die "Couldn't connect to database: " . DBI->errstr;
    >>>>
    >>>> The above works fine in the office from my networked PC. I would
    >>>> like to be able to run this program from home via the Internet. I
    >>>> know my server's IP address, user_login and user_password.
    >>>> 1) How can I modify my $dbh to accomodate this?
    >>>> 2) Do I need to configure "Data Sources (ODBC)" under my login on
    >>>> the remote server so it points to "DB_Name"?
    >>>>
    >>>
    >>> You need to configure a similarly named ODBC source on your home
    >>> computer pointing to the IP of the server with the db. You shouldn't
    >>> need to change the connection string at all.
    >>>

    >> Thanks for the reply. I tried to configure this server but it
    >> continually fails test. With this IP address, I can log into the
    >> server using Remote Desktop. I tried configuring ODBC using 3
    >> different logins including Administrator. All failed. I also noted
    >> that the ODBC configurator does not
    >> send anything out to the net unless I preceed the IP address with a
    >> "//" which I do not use in the office.
    >>
    >> So, what is going on here. Is it possible to configue ODBC for a
    >> server that exists remotely on the Internet as an IP address rather
    >> than being part of a LAN?
    >>

    >
    > I think you need to take this question to a group that deals with MS
    > SQL and/or ODBC at this point. I can only tell you (having connected
    > to MS SQL servers at work from home) that you shouldn't need to take
    > any extra steps when setting up the ODBC source. You might want to
    > check with your database administrator and see if he/she has set up IP
    > blocking on the port to prevent anyone from connecting to the SQL
    > server from outside your office's computers. But that's just a stab in
    > the dark as to the source of the problem...
    >
    > Matt
    >
    >
    >

    Thanks Matt.

    I know the firewall is not blocking this IP address. Otherwise, I
    wouldn't be able to access the server using this IP address and Remote
    Desktop. So, I'll try to look elsewhere for the solution. Again, thanks
    for all your assistance.

    Fred
    Fred Goldberg, Sep 26, 2004
    #5
  6. Fred Goldberg

    Matt Garrish Guest

    "Fred Goldberg" <> wrote in message
    news:Xns95704EB29E018fredackcommcom@216.196.97.142...
    > "Matt Garrish" <> wrote in
    > news:uep5d.36906$:
    >>
    >> I think you need to take this question to a group that deals with MS
    >> SQL and/or ODBC at this point. I can only tell you (having connected
    >> to MS SQL servers at work from home) that you shouldn't need to take
    >> any extra steps when setting up the ODBC source. You might want to
    >> check with your database administrator and see if he/she has set up IP
    >> blocking on the port to prevent anyone from connecting to the SQL
    >> server from outside your office's computers. But that's just a stab in
    >> the dark as to the source of the problem...
    >>

    >
    > I know the firewall is not blocking this IP address. Otherwise, I
    > wouldn't be able to access the server using this IP address and Remote
    > Desktop. So, I'll try to look elsewhere for the solution. Again, thanks
    > for all your assistance.
    >


    But you connect by remote desktop through a different port (3389 v. 1433 for
    MS SQL). It's common practice to limit connections to certain ports for
    security reasons (to prevent your mail server from being used for spam, for
    instance). Hope you get it all sorted out, though.

    Matt
    Matt Garrish, Sep 26, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael

    DBI ODBC

    Michael, Jan 6, 2004, in forum: Perl
    Replies:
    1
    Views:
    807
    Michael
    Jan 6, 2004
  2. Marc Ederis

    py2exe odbc:cannot import dbi module

    Marc Ederis, Mar 2, 2004, in forum: Python
    Replies:
    4
    Views:
    879
    Thomas Heller
    Mar 4, 2004
  3. Replies:
    5
    Views:
    437
  4. Dave Halliday
    Replies:
    3
    Views:
    176
    Dave Halliday
    Sep 12, 2003
  5. Wes Gamble
    Replies:
    1
    Views:
    153
    Gerardo Santana Gómez Garrido
    Apr 5, 2006
Loading...

Share This Page