Re: [Catalyst] Connect Catalyst app to MS SQL Server 2005

2009-05-27 Thread Johannes Plunien

On 27.05.2009, at 21:44, Ascii King wrote:



  schema_class WebTest::Schema
  
 dsn dbi:odbc:WebTestODBC
 userWebGuy
 password   webtest
 AutoCommit   1
  
M/Model::DB>



  schema_class WebTest::Schema
  connect_info dbi:odbc:WebTestODBC
  connect_info WebGuy
  connect_info webtest
  
AutoCommit   1
  


... should do the trick. See also: 
http://search.cpan.org/dist/Catalyst-Model-DBIC-Schema/lib/Catalyst/Model/DBIC/Schema.pm#CONFIG_PARAMETERS

Cheers,
plu

--
Johannes Plunien | mailto:p...@pqpq.de | http://www.pqpq.de/contact/



smime.p7s
Description: S/MIME cryptographic signature
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Connect Catalyst app to MS SQL Server 2005

2009-05-27 Thread Ascii King
I'm trying to connect my Catalyst app to a MS SQL server 2005. I have 
DBIx::Class loaded and I went through the documentation, but I can't 
seem to get the right connection string. Would someone be able to point 
out my mistake and suggest the proper connection string?


Here is the info from my .conf file.


   schema_class WebTest::Schema
   
  dsn dbi:odbc:WebTestODBC
  userWebGuy
  password   webtest
  AutoCommit   1
   
M/Model::DB>

I have created an ODBC connection called WebTestODBC on the machine 
hosting the MSSQL server.

I have also tried the above with a change to the dsn:
dsn   dbi:MSSQL:WebTestODBC

But I always get the same error:

DBIx::Class::ResultSet::first(): DBI Connection failed: Can't connect to 
data source 'HASH(0x43477e8)' because I can't work out what driver to 
use (it doesn't seem to contain a 'dbi:driver:' prefix and the 
DBI_DRIVER env var is not set) at 
C:/Perl/site/lib/DBIx/Class/Storage/DBI.pm line 839


This suggests that it is not reading the  properly and 
instead is looking at the entire thing as a hash. I don't know how to 
get around this. I don't even know if it is the right assumption.


Also, in my \Model\DB.pm I have the following code I took from the 
Catalyst tutorial and modified. I'm not sure if I should just remove it 
or what.


__PACKAGE__->config(
   schema_class => 'WebTest::Schema',
   connect_info => [
 'dbi:odbc:WebTestODBC',
   ],
);

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/