MS SQL errors in my script
am 21.05.2007 20:00:02 von jordanmueller------=_Part_44601_18782032.1179770402648
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello,
I am trying to write a script that connects to a remote MS SQL database.
I have set up dsn on my server before and have no problem connecting. But
something is working this time.
I am pasting my script and the error messages below. If nay one has any
experience with MS SQL Errors that would be very helpful.
++++++++++++++++++++++++++++++++++++++++++++++++++
DBI Script
++++++++++++++++++++++++++++++++++++++++++++++++
my $data_source = 'EXAMPLE';
my $dbh = DBI->connect("dbi:ODBC:$data_source", 'test',
'password') || die "unable to connect: $DBI::errstr";
my $statement = 'SELECT * FROM Patients';
my $sth = $dbh->prepare($statement) ||
die "unable to prepare $statement: $DBI::errstr";
$sth->execute() || die "$DBI::errstr";
my $data = $sth->fetchrow_arrayref();
$dbh->disconnect();
++++++++++++++++++++++++++++++++++++++++++++
ERRORS
+++++++++++++++++++++++++++++++++++++++++++++
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
'Patients'. (SQL-42S02)
[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be
prepared. (SQL-42000)(DBD: st_execute/SQLExecute err=-1) at rcmp.pl line 32.
+++++++++++++++++++++++++++++++++++++++++++++
The connection seems to be fine, I don't know what to do about SQL Server
errors.
Thank you,
Jordan
------=_Part_44601_18782032.1179770402648--