freelanceprogrammers.org Forum Index » Perl

Urgent Reply needed


View user's profile Post To page top
chdsethi Posted: Wed Jan 25, 2006 12:29 pm


Joined: 24 Jan 2006

Posts: 2
Urgent Reply needed
Hi all

I m trying "Database Connectivity" using Perl but the problem is that
i`m not able to locate the module named "WIN32::ODBC" with extension
`.pm`; I`m either using the ActivePerl-5.8.7 - MS Win32 or Perledit
version.Here i`m enclosing a small script which i tried but didn`t
workd.

----------------------------------------------------------
#!c:/perl/bin/perl.exe -w
require "cgi-bin.pl";
use Win32::ODBC;

if(!($db = new Win32::ODBC("dsn = PerlOracle;UID = Sethi;PWD = sethi"
))) {
print "content-type: text/html

";
print "<html><head><title> Database Test </title></head>";
print "body bgcolor = "#ffffff" text = "088000"><h2> Error
Connecting The Database</h2>";
print "<P> Please Try Your Request </p></body></html>";
exit;
}

else {
print "Content-type: text/html

Connection OK";
}
----------------------------------------------------------

Plz guide me

regards

Sethi
Reply with quote
Send private message
View user's profile Post To page top
geethsruthi Posted: Wed Jan 25, 2006 1:25 pm


Joined: 25 Jan 2006

Posts: 2
Urgent Reply needed
Dear Sethi,

you will have to give a DSN name in creating an odbc obeject. For creating the
DSN, use Win32::ODBC::ConfigDSN with database path, username password as
arguments to it.


Geetha






chdsethi <chdsethi@...> wrote:
Hi all

I m trying "Database Connectivity" using Perl but the problem is that
i`m not able to locate the module named "WIN32::ODBC" with extension
`.pm`; I`m either using the ActivePerl-5.8.7 - MS Win32 or Perledit
version.Here i`m enclosing a small script which i tried but didn`t
workd.

----------------------------------------------------------
#!c:/perl/bin/perl.exe -w
require "cgi-bin.pl";
use Win32::ODBC;

if(!($db = new Win32::ODBC("dsn = PerlOracle;UID = Sethi;PWD = sethi"
))) {
print "content-type: text/html

";
print "<html><head><title> Database Test </title></head>";
print "body bgcolor = "#ffffff" text = "088000"><h2> Error
Connecting The Database</h2>";
print "<P> Please Try Your Request </p></body></html>";
exit;
}

else {
print "Content-type: text/html

Connection OK";
}
----------------------------------------------------------

Plz guide me

regards

Sethi








SPONSORED LINKS
C programming language Computer programming languages Java
programming language The c programming language C programming language
Concept of programming language

---------------------------------
YAHOO! GROUPS LINKS


Visit your group "Perl_Official" on the web.

To unsubscribe from this group, send an email to:
Perl_Official-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


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





Send instant messages to your online friends http://in.messenger.yahoo.com

[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
Rob_Wilson_98 Posted: Wed Jan 25, 2006 7:33 pm


Joined: 02 Aug 1999

Posts: 11
Urgent Reply needed
--- In Perl_Official@yahoogroups.com, "chdsethi" <chdsethi@y...> wrote:
>
> Hi all
>
> I m trying "Database Connectivity" using Perl but the problem is that
> i`m not able to locate the module named "WIN32::ODBC" with extension
> `.pm`; I`m either using the ActivePerl-5.8.7 - MS Win32 or Perledit
> version.Here i`m enclosing a small script which i tried but didn`t
> workd.
>

It should be in the activeperl version, I know nothing about the
perledit version. Do a perl -V and look at the directories in @INC at
the bottom. Check those places for a Win32 folder. Inside Win32
folders, look for ODBC.pm. If it is not found, use PPM to install
Win32::ODBC. The documentation for PPM is good for this.

> ----------------------------------------------------------
> #!c:/perl/bin/perl.exe -w
> require "cgi-bin.pl";
> use Win32::ODBC;
>
> if(!($db = new Win32::ODBC("dsn = PerlOracle;UID = Sethi;PWD = sethi"
> ))) {
> print "content-type: text/html

";
> print "<html><head><title> Database Test </title></head>";
> print "body bgcolor = "#ffffff" text = "088000"><h2> Error
> Connecting The Database</h2>";
> print "<P> Please Try Your Request </p></body></html>";
> exit;
> }
>
> else {
> print "Content-type: text/html

Connection OK";
> }
> ----------------------------------------------------------
>
> Plz guide me
>
> regards
>
> Sethi
>

Do not "require cgi-bin.pl". This is the very old way of doing CGI
stuff. Instead "use CGI". Of course, if you are more comfortable
with cgi-bin.pl, have fun with it. I`ve used both and I much prefer
to "use CGI".

If you have problems with Win32::ODBC, you can also use DBI and
DBD::ODBC. They`re more portable, anyway.

If the above doesn`t help, an actual error message would be good.
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help