DBI::ODBC Remote Login to Server

F

Fred Goldberg

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
 
M

Matt Garrish

Fred Goldberg said:
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
 
F

Fred Goldberg

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
 
M

Matt Garrish

Fred Goldberg said:
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
 
F

Fred Goldberg

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
 
M

Matt Garrish

Fred Goldberg said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top