[Nh-pm] RE: Nh-pm Digest, Vol 1, Issue 49

Black, Franklin fblack at docucorp.com
Fri Jul 11 13:18:58 CDT 2003


use DBI::DBD;   # simple test to make sure it's okay
my $db;
use Config;
use Getopt::Long;
use strict;


my $db = DBI->connect('DBI:ODBC:<odbc connection>,<user>,<password>)
		or die "Couldn't connect to database: " . DBI->errstr;


my $SelLine="select * from table";
my $sth = $db->prepare("$SelLine")
                or die "Couldn't prepare statement: " . $dbh->errstr;





$sth->execute();
my @Data;
my $i;

while (@Data = $sth->fetchrow_array())
{

 print @Data;

}

-----Original Message-----
From: nh-pm-request at mail.pm.org [mailto:nh-pm-request at mail.pm.org]
Sent: Friday, July 11, 2003 12:00 PM
To: nh-pm at mail.pm.org
Subject: Nh-pm Digest, Vol 1, Issue 49


Send Nh-pm mailing list submissions to
	nh-pm at mail.pm.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://mail.pm.org/mailman/listinfo/nh-pm
or, via email, send a message with subject or body 'help' to
	nh-pm-request at mail.pm.org

You can reach the person managing the list at
	nh-pm-owner at mail.pm.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Nh-pm digest..."


Today's Topics:

   1. Re: ODBC Connections  (Paul L Lussier)


----------------------------------------------------------------------

Message: 1
Date: Thu, 10 Jul 2003 13:59:25 -0400
From: Paul L Lussier <pll at lanminds.com>
Subject: Re: [Nh-pm] ODBC Connections 
To: Ben Boulanger <ben at blackavar.com>
Cc: NH Perlmongers <nh-pm at mail.pm.org>
Message-ID: <20030710175926.6A652F5E2 at tater>

In a message dated: Thu, 10 Jul 2003 12:00:36 EDT
Ben Boulanger said:

>Hi,
>	I'm trying to setup an ODBC connection to a MSSQL Server.  I've 
>downloaded the DBD-ODBC module, but I'm just not familiar enough with 
>ODBC..  Anyone have any experience with using perl (on linux) to do this?  
>
>I'm not understanding how to get the Microsoft SQL Server driver setup to 
>work here...

Never done this, but my understanding was that you should just need 
to write a connect line, which is pretty standard, and then 
everything else is either a prepare, or exec call on the DB handle?

Do you have the DBD/DBI book?
-- 

Seeya,
Paul
--
Key fingerprint = 1660 FECC 5D21 D286 F853  E808 BB07 9239 53F1 28EE

	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!



------------------------------

_______________________________________________
Nh-pm mailing list
Nh-pm at mail.pm.org
http://mail.pm.org/mailman/listinfo/nh-pm


End of Nh-pm Digest, Vol 1, Issue 49
************************************



More information about the Nh-pm mailing list