sorry bob,
I'm a bt confused here as to what exactly the problem is your experiencing

are you unable to connect to mysql db on winxp running activestates perl?
What error do you get?

I would guess this is the case as your PPM dump didn't seem to show a DBD
for mysql. If this is the case, can you do a PPM INSTALL DBD-Mysql?



As far as your 2nd question goes (which in itself looks odd coz it would
seem to indicate that DBD-MySQL is present) seems to be caused by a lack of
a ":" between mysql & meet_a_geek


joel




-----Original Message-----
From: Bob T [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2002 04:16
To: [EMAIL PROTECTED]
Subject: Fw: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD



----- Original Message -----
From: Bob T
To: [EMAIL PROTECTED]
Sent: Thursday, March 21, 2002 11:10 PM
Subject: Fw: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD



----- Original Message -----
From: Bob T
To: [EMAIL PROTECTED]
Sent: Thursday, March 21, 2002 11:08 PM
Subject: DBI w/ DBD:ODBC or DBD:mysql or DBIx-AnyDBD


I am new to Perl DBI programming  it is fairly simple..Except I am not
sure I am set up correctly or am using the correct module combinations...

I am using both Mysql 3.23.44nt and 3.23.43 Linux..as well as PostgreSQL
7.1 Linux and on WinXP on Cygwin.

Perl on Linux was straight forward but the Perl on WIn is a bit Different.
I ran a simple script to insert records in a table as test and it worked but
I am
unsure that the WinXP install of Perl and DBI is correct that is do I have
the
correct modules in place. Should I be running the date through a DBD:ODBC or
a DBD:mysql.

Below is my PPM query to my Perl Package Manager:
Settings\bobby\Application Data\ActiveState\ActiveState.lic' is present.
ppm> query DBI
Querying target 1 (ActivePerl 630)
    1. DBI         [1.14] Database independent interface for Perl
    2. DBIx-AnyDBD [1.98] DBD independant class
    3. DBIx-Easy   [0.10] Easy to Use DBI interface
ppm> query DBD
Querying target 1 (ActivePerl 630)
    1. DBD-ODBC    [0.28] ODBC driver for the DBI module.
    2. DBIx-AnyDBD [1.98] DBD independant class
ppm>

My test Perl Script...
#!/perl/bin/perl -w

use DBI;

my $dbh = DBI-> connect( "DBI:mysql:Meet_A_Geek", "bobby", "bobby") or die
"Can't connect";

# Insert the values
$dbh->do("INSERT INTO customers (First_Name, Last_Name) VALUES ('Renee',
'Robertson')");
$dbh->do("INSERT INTO customers (First_Name, Last_Name) VALUES ('Larry',
'Isacson')");
$dbh->do("INSERT INTO customers (First_Name, Last_Name) VALUES ('Mark',
'Harrison')");

# Disconnect from the database
$dbh->disconnect;

exit;

AND Lastly... When I replace the first 7 lines like so... I get a failure
#!/perl/bin/perl -w

use DBI;

$database = "Meet_A_Geek";
$driver = "DBI:mysql";
my $dbh = DBI-> connect( "$driver:$database", "bobby", "bobby") or die
"Can't connect";

The error referred to database not being quoted but then after I used the
first script to establish a connection the second script worked???

Sorry for the multiple questions ..Can anyone Help..

Bob T.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to