For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > March 2005 > SQL Server Connection strings









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQL Server Connection strings
Zeke Hoskin

2005-03-31, 3:58 am

I need to write a Perl program to append records to a SQL Server db. I
can connect to it using a connection string lifted from an Access
project:

my $dbh = DBI->connect("DBI:ADO:Provider=Microsoft.Access.OLEDB.10.0;
Persist Security Info=False;Data Source=##NAMEOFSERVER##;
Integrated Security=SSPI;Initial Catalog=##NAMEOFDB##;Data
Provider=SQLOLEDB.1")
or die "connection failed: $DBI::errstr\n";
This (surprisingly) works if I just query the database, but if I send
it a correct INSERT statement, it carries it out and then crashes with
no DBI errmsg and a screen that says "Microsoft has to shut down the
Perl database interface". (An incorrect insert just dies properly with
a message.)

If I edit the Provider= phrase, it very nicely refuses to connect and
dies with a long and informative message. Obviously there is a correct
Provider phrase, but I can't find it. Suggestions?
Thanks//Zeke Hoskin
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com