Hi,
I am trying to connect to our remote SQL Server, via our webspace (i.e. not on the same machine), I am able to create the DSN but when trying to open the DB connection I get a strange message about Microsoft Access.
Error connecting: [-1023] [] "[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides."
? i'm not trying to connect to MS Access, any ideas on why this is hapenning, I can connect from our webhost to the same server using ASP fine, just not with PERL, am I missing an attribute somewhere? Thanks 1DMF,
...code is below.....
#!/usr/bin/perl
# Show Errors to Browser
use CGI::Carp qw(fatalsToBrowser);
# Use Win32
use Win32::ODBC;
# Set Variables
my $DSN = "Website";
my $Driver = "SQL Server";
my $Desc = "DSN DESCRIPTION";
my $Server = "SERVER NAME";
my $Dbase = "DATABASE NAME";
my $Network = "DBMSSOCN";
my $UID = "USERID";
my $PWD = "PASSWORD";
my $IP = "IP ADDRESS OF REMOTE SQL SERVER";
# Create DataSource
if (Win32::ODBC::ConfigDSN(
ODBC_ADD_DSN,
"$Driver",
("DSN=$DSN", # DSN Name
"DESCRIPTION=$Desc", # Description
"SERVER=$Server", # server name
"ADDRESS=$IP", # server IP addr
"DATABASE=$Dbase", # database
"NETWORK=$Network" # TCP/IP Socket Lib
))){print "DSN Created\n";}
else { die "Unable to create DSN:" . Win32::ODBC::Error( ) . "\n"; exit(); }
# Open DB Connection
$db = new Win32::ODBC("DSN=$DSN;UID=$UID;PWD=$PWD;") || die "Error connecting: " . Win32::ODBC::Error();
exit();
I am trying to connect to our remote SQL Server, via our webspace (i.e. not on the same machine), I am able to create the DSN but when trying to open the DB connection I get a strange message about Microsoft Access.
Error connecting: [-1023] [] "[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides."
? i'm not trying to connect to MS Access, any ideas on why this is hapenning, I can connect from our webhost to the same server using ASP fine, just not with PERL, am I missing an attribute somewhere? Thanks 1DMF,
...code is below.....
#!/usr/bin/perl
# Show Errors to Browser
use CGI::Carp qw(fatalsToBrowser);
# Use Win32
use Win32::ODBC;
# Set Variables
my $DSN = "Website";
my $Driver = "SQL Server";
my $Desc = "DSN DESCRIPTION";
my $Server = "SERVER NAME";
my $Dbase = "DATABASE NAME";
my $Network = "DBMSSOCN";
my $UID = "USERID";
my $PWD = "PASSWORD";
my $IP = "IP ADDRESS OF REMOTE SQL SERVER";
# Create DataSource
if (Win32::ODBC::ConfigDSN(
ODBC_ADD_DSN,
"$Driver",
("DSN=$DSN", # DSN Name
"DESCRIPTION=$Desc", # Description
"SERVER=$Server", # server name
"ADDRESS=$IP", # server IP addr
"DATABASE=$Dbase", # database
"NETWORK=$Network" # TCP/IP Socket Lib
))){print "DSN Created\n";}
else { die "Unable to create DSN:" . Win32::ODBC::Error( ) . "\n"; exit(); }
# Open DB Connection
$db = new Win32::ODBC("DSN=$DSN;UID=$UID;PWD=$PWD;") || die "Error connecting: " . Win32::ODBC::Error();
exit();