Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Perl and MSSQL 2000
System
im running TS 6 and Perl 5.005_03 on w2k. When connecting to mssql7, I have no problem, but our DB-Admin delivered mssql 2000 with the form: SERVER/INSTANCE, an when calling that server, I do not get connected.
Does anyone have an idea why, and how to fix?
The connectstring looks like this:
my $DSN = 'driver={SQL Server};Server=SERVER/INSTANCE;database=db;uid=id;pwd=password;';
Kind Regards
Per Staffe
Find more posts tagged with
Comments
Adam Stoller
Before you spend too much time trying to get it to work with TS6.0 - I suggest you upgrade to 6.1 which has a newer version of Perl (5.8.2) and may require you getting newer DBI/DBD modules -- this *might* fix the issue in and of itself, but if it doesn't, you'll at least be working towards a solution with less chance of it breaking as soon as you upgrade to 6.1...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Hi Fish,
Well you are proberly right, but my schedules does not allow an upgrade.
- Per
Adam Stoller
Well, make a note about it because when you do upgrade this will probably be an issue again.
As for the existing problem - sorry, can't help you there - hopefully someone else (more DB-literate than I) will be able to assist.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
stefanmaier
Hi,
we use TS5.5.2 SP5 and SQL2000. Perhaps this would be ok for you:
1. Open ODBC Data Source Administrator on your windows box (Start -> Settings -> Control Panel -> Administrative Tools -> Data Sources (ODBC))
2. Create a new System DSN (your database admin can give you all necessary data)
3. Try this perl code:
...
#Open conenction
my $dbh = DBI->connect('DBI
DBC:Name_of_System_DSN',
'Your_User',
'Your_Passwort',
{RaiseError => 1, AutoCommit => 1});
...
#Query execute
if ($dbh) {
my $sth = $dbh->prepare($query);
if (defined $sth) {
$sth->execute;
while ((my
@row)
= $sth->fetchrow_array) {
...
}
$sth->finish;
}
}
...
#Close
if ($dbh) {
$dbh->disconnect;
$dbh=0;
}
I hope this would help...
Regards,
Stefan