Re: Using Modules
by earthboundmisfit (Chaplain) on Dec 12, 2002 at 16:42 UTC
|
At a command prompt, type perl -V (make sure it's a capital V)... somewhere in the out put (at the end on my W2K WS) is the contents of @INC
@INC:
C:/Perl/lib
C:/Perl/site/lib
.
Modules on my WS exist in either of these two directories. To install modules on Windows, try using PPM if you have the ActiveState distro or CPAN.pm if some other.
C:\>ppm
PPM interactive shell (2.1.5) - type 'help' for available commands.
PPM> install DBI
Install package 'DBI?' (y/N):
BTW, I highly recommend using the DBI module over Win32::ODBC
----
I am what I read | [reply] [Watch: Dir/Any] [d/l] [select] |
|
BTW, I highly recommend using the DBI module over Win32::ODBC
Don't forget that you'll also need DBD::ODBC as well.
--
vek
--
| [reply] [Watch: Dir/Any] |
|
#! perl -w
use strict;
use DBI;
my @driver_names = DBI->available_drivers;
print join("\n",@driver_names), "\n";
my @dataSources = DBI->data_sources ("ODBC");
print join("\n-",@dataSources);
----
I am what I read | [reply] [Watch: Dir/Any] [d/l] |
|
I downloaded the DBI module and used WINPKZIP to extract it into a folder in my perl dir. Now what? I seem to have PPM installed, but I can't find a ppd file for DBI. The docs say to copy the module into my perl directory, but I'm not sure what to copy to where. Man, I feel dumb!! Thanks for you help.
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |
|
Re: Using Modules
by John M. Dlugosz (Monsignor) on Dec 12, 2002 at 16:31 UTC
|
You need to download and install that module on your machine. Read up on "PPM" (Perl Package Manager) in the ActiveState documentation. If you don't have trouble with proxies or whatnot, doing PPM install Win32-ODBC at a command-prompt should do the trick. The docs show how to manually download first if it can't handle that. | [reply] [Watch: Dir/Any] [d/l] |
Re: Using Modules
by UnderMine (Friar) on Dec 12, 2002 at 16:35 UTC
|
This sound like an installation issue. Win32::ODBC is a old method of using ODBC connections under perl. This is about 5 years old and predates Windows 2000 by some margin.
I would recommend DBI and DBD::ODBC driver to generate more maintainable and portable code unless there is a particular reason for using Win32::ODBC (eg. legacy code). If you require multiple datasets from SQL Server which Win32::ODBC supported have a look at DBD::FreeTDS.
Hope it helps
UnderMine | [reply] [Watch: Dir/Any] |
Re: Using Modules
by meetraz (Hermit) on Dec 12, 2002 at 20:39 UTC
|
I gave up on using ODBC on windows a very long time ago. Since DBI doesn't seem to have a MS-SQL interface, I currently use Win32::OLE and Microsoft's ADO library for all of my non-oracle database work. You can use Win32::OLE to create ADODB.Connection objects, run ADODB.Command objects, and eventually work on ADODB.RecordSet objects, just like you traditionally would in ASP or VB.
| [reply] [Watch: Dir/Any] |