Can C::D::AutoLoader work with C::D::MSSQL? Is it a good idea?
[prev]
[thread]
[next]
[Date index for 2005/04/20]
Hello everyone,
First, I'd like to thank all of the developers who have contributed to
Class::DBI. The time it's saved me is unbelievable.
I have a few questions about using Class::DBI with a MS SQL Server via
DBD::ODBC. I have DBD::ODBC setup with the Openlink driver and MS SQL
Server 2000 working without any problems.
I've begun using Class::DBI with mod_perl and have set it up like
# in startup.pl
$db_options =3D {
Taint =3D> 1,
PrintError =3D> 1,
RaiseError =3D> 1,
AutoCommit =3D> 0,
FetchHashKeyName =3D> 'NAME_lc',
ShowErrorStatement =3D> 1,
ChopBlanks =3D> 1,
RootClass =3D> 'DBIx::ContextualFetch'
};
Apache::DBI->connect_on_init
('dbi:ODBC:ivr',
'user','pass',
$db_options
);
use IVR::DBI;
use IVR::TestResponses;
# in IVR::DBI
package IVR::DBI;
use strict;
use base 'Class::DBI';
__PACKAGE__->connection('dbi:ODBC:ivr', 'user', 'pass', {
Taint =3D> 1,
PrintError =3D> 1,
RaiseError =3D> 1,
AutoCommit =3D> 0,
FetchHashKeyName =3D> 'NAME_lc',
ShowErrorStatement =3D> 1,
ChopBlanks =3D> 1,
RootClass =3D> 'DBIx::ContextualFetch'
}
);
1;
This works quite well, but I've got lots of tables to setup in the IVR
namespace and I'd heard about Class::DBI::AutoLoader.
When I've tried this instead of the Apache::DBI and use IVR calls:
use Class::DBI::AutoLoader (
dsn =3D> 'dbi:ODBC:ivr',
username =3D> 'user',
password =3D> 'pass',
options =3D> $db_options,
namespace =3D> 'IVR',
);
I get this error when starting Apache:
[Wed Apr 20 10:28:53 2005] [error] Can't locate object method
"set_up_table" via package "IVR::IVRDboSyscolumns" at
/usr/lib/perl5/site_perl/5.8.5/Class/DBI/AutoLoader.pm line 73.\nBEGIN
failed--compilation aborted at /usr/local/apache/conf/startup.pl line
106.\nCompilation failed in require at (eval 2) line 1.\n
Syntax error on line 1203 of /usr/local/apache/conf/httpd.conf:
Can't locate object method "set_up_table" via package
"IVR::IVRDboSyscolumns" at
/usr/lib/perl5/site_perl/5.8.5/Class/DBI/AutoLoader.pm line 73.
BEGIN failed--compilation aborted at /usr/local/apache/conf/startup.pl
line 106.Compilation failed in require at (eval 2) line 1.
Can Class::DBI::MSSQL help me get around this? The reason I ask is
that it's POD states that it has a set_up_table method.
Another question is, is Class::DBI::AutoLoader a "good" idea for me in
this situation? Or am I better off writing each tables "module"
manually under the IVR namespace.
Any help is appreciated!
Kevin
--=20
Kevin Old
kevinold@xxxxx.xxx
|
Can C::D::AutoLoader work with C::D::MSSQL? Is it a good idea?
Kevin Old 15:26 on 20 Apr 2005
|