Hi monks, I am trying to connect to a SQL Server 2008 local db on my computer. i've written a small perl script using the DBI module. I am running Activate State Perl v5.8.8. Here is the code. Note that my server name is "MADDY" and no pw to connect. Note that i also installed the DBI module recently using ppm.
use DBI; $dsn = "MADDY"; $user = "Maddy17"; $pw = ""; $dbh = DBI->connect('$dsn,$user,$pw'); $sth = $dbh->prepare ("select * from sysobjects where name = ' +pub_titles' and type = 'P' and uid = USER_ID()"); $sth->execute(); while ( @row = $sth->fetchrow_aray ) { print "@row\n"; } $dbh->disconnect();
The error it throws at command line is as follows: "Can't connect to data source '$dsn,$user,$pw' because I can't work out what driver to use (it doesnt seem to contain a 'dbi:driver:' prefix and the DBI_DRIVER env var is not set) at data.pl line9"
In reply to DBI Module Question by Irishboy24
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |