Showing posts with label perl. Show all posts
Showing posts with label perl. Show all posts

Sunday, March 25, 2012

Connecting to SQL 2005 via DBI Perl and Vista problems.

I am trying to connect to a 2005 SQL server though perl using the DBI module.
When the perl script is uploaded to my web server the connection is made with
no problems but if I download the file to my local machine and run the file I
get "[Microsoft][ODBC Driver Manager] Data source name not found and no
default driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1);" I
have added the DSN into Vista 6 times and the test run fine but I can not run
this perl script, or any other perl script that uses DBI to get to the SQL
server. Can anyone help me?
Never Mind, found it. Why do the answers only show up after asking for help.
Found this site
http://msmvps.com/blogs/spywaresucks/archive/2007/05/11/897398.aspx
and whent via run command to the syswow64 version of ODBC and added it in
there and worked. But I find it really odd that when I when to the ODBC via
Admin Tools in Control Panel it was not working. O, well.
"Eagle_f90" wrote:

> I am trying to connect to a 2005 SQL server though perl using the DBI module.
> When the perl script is uploaded to my web server the connection is made with
> no problems but if I download the file to my local machine and run the file I
> get "[Microsoft][ODBC Driver Manager] Data source name not found and no
> default driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1);" I
> have added the DSN into Vista 6 times and the test run fine but I can not run
> this perl script, or any other perl script that uses DBI to get to the SQL
> server. Can anyone help me?

Connecting to SQL 2005 via DBI Perl and Vista problems.

I am trying to connect to a 2005 SQL server though PERL using the DBI module
.
When the PERL script is uploaded to my web server the connection is made wit
h
no problems but if I download the file to my local machine and run the file
I
get "[Microsoft][ODBC Driver Manager] Data source name not found and
no
default driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1);" I
have added the DSN into Vista 6 times and the test run fine but I can not ru
n
this PERL script, or any other PERL script that uses DBI to get to the SQL
server. Can anyone help me?Never Mind, found it. Why do the answers only show up after asking for help.
Found this site
http://msmvps.com/blogs/spywaresuck.../11/897398.aspx
and whent via run command to the syswow64 version of ODBC and added it in
there and worked. But I find it really odd that when I when to the ODBC via
Admin Tools in Control Panel it was not working. O, well.
"Eagle_f90" wrote:

> I am trying to connect to a 2005 SQL server though PERL using the DBI modu
le.
> When the PERL script is uploaded to my web server the connection is made w
ith
> no problems but if I download the file to my local machine and run the fil
e I
> get "[Microsoft][ODBC Driver Manager] Data source name not found a
nd no
> default driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1);" I
> have added the DSN into Vista 6 times and the test run fine but I can not
run
> this PERL script, or any other PERL script that uses DBI to get to the SQL
> server. Can anyone help me?

Tuesday, February 14, 2012

connect using perl (solaris platform)

I need to connect to Express edition of sql server installed on my machine, from perl (solaris platform). How should the connection string containing server, port, database etc look like ?

Can any one tell me how to find the *port number* that the local server is using.

|||

hi,

[quote user]

I need to connect to Express edition of sql server installed on my machine, from perl (solaris platform). How should the connection string containing server, port, database etc look like ?

please have a look at connection string samples..

Can any one tell me how to find the *port number* that the local server is using.

you can find the used port via SQL Server Configuration Manager.. select the SQL Server 2005 Network configurations node, which expands in several instances nodes.. select the appropriate instance node.. in the right pane, network protocols will be listed (in order to be available, the desired network protocol must be "enabled")...

select TCP/IP, rx click and access it's properties.. in the IP Addresses tab the used port will be listed.. if dynamic port is set, the instance is configured for dynamic assigned address and this value "could" change at next instance's startup as the instance will try, at it's startup, to get the old used port but it could be relocated to alternative one if the old port has been used (in the meanwhile) by other services.. in case of dynamic assigned ports, the SQL Server Browser, a service listening on port UDP 1434, is required to resolve remote connections..

the SQL Server Browser intercepts incoming connections and, after inspecting the local registry for the dynamic assigned port used by the instance, redirects the remote connection(s) to the appropriate port where the instance is listening on..

regards

|||UsHaving a single instance , use

netstat -a -b at the command prompt and look for the sqlservr.exe process

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

>> you can find the used port via SQL Server Configuration Manager

I could not find Configuration Manager in the management studio... where can I find that.

Thanks,

|||

hi,

it's not in Management Studio.. it's in the Microsoft SQL Server 2005 -> Configuration tools folder..

regards

Friday, February 10, 2012

connect to SQL server 2005 databse using perl

we moved recently to SQL server 2005, i have perl scripts that i use to connect to the database, retrieve information and updata datas. since we moved the perl scripts are unable to connect to the database. I created the system DSN in the odbc manager that is used to connect to that database. this is the error message we are getting when we try to cnnect to the databse :
DBI connect('billing3','dbo',...) failed: [Microsoft][ODBC Driver Manager] Data
source name not found and no default driver specified (SQL-IM002)(DBD: db_login/
SQLConnect err=-1) at night_process.pl line 30

the perl script that tries to connect is :
#!/usr/bin/perl -w
use File::Copy;
use Date::Calc qw(Today Add_Delta_Days);
use Cwd;
use Net::FTP;
use DBI; # database connection ;

$DSN="billing3";

$user="dbo";
$pass="toto";

#connect to the database

$dbh = DBI->connect("DBI:ODBC:$DSN", $user, $pass);This is an SSIS forum. Your post has nothing in regards to SSIS so I would advise posting to another forum or several others as it is unclear which forum would be best suited to answer this question.

Thanks,
Matt