Hello you guys, I trying to run this script to create two tables, but I got an error with the odbc any of you that have odbc on linux can run it and tell if run correctly. I Have to do this homework and the professor is asking for making it in Acces.

This is the error I got

install_driver(ODBC) failed: Can't locate DBD/ODBC.pm in @INC (you ma +y need to install the DBD::ODBC module) (@INC contains: /etc/perl /us +r/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 / +usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/li +b/site_perl .) at (eval 4) line 3. Perhaps the DBD::ODBC perl module hasn't been fully installed, or perhaps the capitalisation of 'ODBC' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Proxy, Sponge, mysql. at createdb.pl line 18.
#u!/usr/bin/perl #use strict; use warnings; use v5.10; # Para el uso de la funcion sy() use DBI; say "Script para crear base de datos Acces"; # Configuracion de la base de datos my $datasource ="driver=Microsoft Access Driver (*.mdb);dbq=new.mdb"; my $username = "root"; my $password = 'mysql'; # Conectarse a la base de datos my $dbh = DBI->connect("dbi:ODBC:$datasource", $username, $password) || die "Error connecting: $!"; # Creando la tabla my $table1= "CREATE TABLE table1 (pike varchar2(200), CodigoEmp varchar2(200), NomEmp varchar2(200), Apellido varchar2(200), NombrePc varchar2(200), DireccionIp varchar2(15), email varchar2(200), posicion varchar2(200), recinto varchar2(200), logu varchar2(200), Logs varchar2(100) )"; my @table2 = ( "CREATE TABLE table2 ( EstoEmp varchar2 (200), EstaEmpleado varchar(200), GrupoUs varchar(200), Aplicacines varchar(200) );" ); # Ejecutando los statements my $sth = $dbh->prepare($table1); $sth->execute; say "Todas las tablas se han creado correctamente!"; # Desconectarse de la base de datos $dbh->disconnect();
Thanks

In reply to Testing Script ODBC by emorfa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.