> 
> I'm running ActiveState perl 5.8.0 on a WIN2K box with MS SQL 
> Server 2000.
> 
> Recently I updated DBD-ODBC to v1.05 and DBI to v1.35
> 
> Now I get the following errors executing some sql commands
> 
> CREATE SQLSTMT:[CREATE DATABASE POMS_SER ON (NAME = 
> 'POMS_SER_DAT', FILENAME = 
> 'd:\Database\POMS\POMS_SER_Data.MDF', SIZE = 10MB) LOG ON ( 
> NAME = 'POMS_SER_LOG', FILENAME = 
> 'd:\Database\POMS\POMS_SER_Log.MDF', SIZE = 5MB)]
> 
> DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server 
> Driver][SQL Server]The CREATE DATABASE process is allocating 
> 10.00 MB on disk 'POMS_SER_DAT'. (SQL-01000) [Microsoft][ODBC 
> SQL Server Driver][SQL Server]The CREATE DATABASE process is 
> allocating 5.00 MB on disk 'POMS_SER_LOG'. (SQL-01000) at 
> D:\Transportation\POMS\Tools\Scotts_Unified_POMS_Install.pl line 766.
> 
> Database POMS_SER Created!

> 
> I've seen similar problems with the newer versions of the dbi 
> and odbc software on my WIN2K box running MS SQL Server.  
> Have not seen any reported workarounds or fixes yet.

On the surface, it looks like the create database informational message is
being treated as an error and that may be intentional on the SQL Server ODBC
driver side.  I'll have to look at it.  But, you should think about calling
"do" for these, as neither of these statements should return result sets (At
least I do not believe they should.)  That should solve the second issue.

Jeff

> 
> EXEC SQLSTMT:[USE POMS_SER
> exec sp_grantdbaccess 'LLVAH-STRICSC\IUSR_POMS_SER', 'IUSR_POMS_SER']
> 
> DBD::ODBC::st execute failed: [Microsoft][ODBC SQL Server 
> Driver]Invalid cursor state (SQL-24000)(DBD: 
> dbd_describe/SQLNumResultCols err=-1) at 
> D:\Transportation\POMS\Tools\Scotts_Unified_POMS_Install.pl 
> line 827. Can't execute statement USE POMS_SER exec 
> sp_grantdbaccess 'LLVAH-STRICSC\IUSR_POMS_SER', 
> 'IUSR_POMS_SER' [Microsoft][ODBC SQL Server Driver]Invalid 
> cursor state (SQL-24000)(DBD: dbd_describe/SQLNumResultCols 
> err=-1) at 
> D:\Transportation\POMS\Tools\Scotts_Unified_POMS_Install.pl line 827.
> 
> Code fragments that generated this follow;
> 
>  my $the_odbc = 'dbi:ODBC:LocalServer';
> 
>   my $dbh = DBI->connect($the_odbc, '', '', {RaiseError=>0});
> 
>   my $sqlstmt_s = "CREATE DATABASE $db_name";
>   $sqlstmt_s .= " ON (NAME = \'$db_logical_name\', FILENAME = 
> \'$db_file_name\', SIZE = $db_size)";
>   $sqlstmt_s .= " LOG ON ( NAME = \'$tlog_logical_name\', 
> FILENAME = \'$tlog_file_name\', SIZE = $tlog_size)";
>   print "CREATE SQLSTMT:[$sqlstmt_s]\n";
>   my $sth_s = $dbh->prepare($sqlstmt_s) || die "Can't prepare 
> statement\n$sqlstmt_s\n$DBI::errstr";
>   my $rc = $sth_s->execute || die "Can't execute 
> statement\n$sqlstmt_s\n$DBI::errstr"; #### LINE 766
>   $sth_s->finish;
>   print "Database $db_name Created!\n";
> 
>   $sqlstmt_s = "USE $db_name";
>   $sqlstmt_s .= "\nexec sp_grantdbaccess 
> \'$db_user_and_domain\', \'$db_user\'";
>   print "EXEC SQLSTMT:[$sqlstmt_s]\n";
>   $sth_s = $dbh->prepare($sqlstmt_s) || die "Can't prepare 
> statement\n$sqlstmt_s\n$DBI::errstr";
>   $rc = $sth_s->execute || die "Can't execute 
> statement\n$sqlstmt_s\n$DBI::errstr"; ##### LINE 827
>   $sth_s->finish;
> 
> 
> E. Scott Stricker - NGIT @ Smartlink
> 


Reply via email to