in reply to Testing Script ODBC

It's really impossible to help without seeing the error, please post it here. You can edit your post and add it. Here are a few ideas:

It seems unlikely that you are really running Microsoft Access on linux. You're using 'mysql' as a password: is your database actually MySQL?

You're using the VARCHAR2 data type but that's an Oracle data type. I don't know for sure but I don't think you can use it in Access. It causes an error if you try to use it in MySQL.

You have one SQL string in a scalar and one in an array, that's probably not what you want.

For creating tables, once you have a working database handle, I suggest using DBI's do():

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) )"; $dbh->do( $table1 ) or die $dbh->errstr;

Hope this helps!

The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Testing Script ODBC
by chacham (Prior) on Nov 06, 2015 at 16:29 UTC

    You're using the VARCHAR2 data type but that's an Oracle data type.

    Good catch! FWIW, i tested them, the statements run fine in Oracle. :)

Re^2: Testing Script ODBC
by emorfa (Initiate) on Nov 06, 2015 at 12:27 UTC

    Inick

    Thank for your prompt response this is a homework the professor order me to use Acces with ODBC, but for me it like impossible install ODBC on ubuntu I got many issues with that, I Just want any you guys test this script and if work let me know otherwise tell which is the error present.

    Thanks 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.

      Which version of Ubuntu ?

      poj
        Hello Poj

        Can you check this script un you linu

        My ubuntu is 14.04.2 LTS

        Thank you Poj it work now but I'm getting this errror that do you think I have to change in my code ?

         DBI connect('driver=Microsoft Access Driver (*.mdb);dbq=new.mdb','root',...) failed: [unixODBC][Driver Manager]Data source name not found, and no default driver specified (SQL-IM002) at createdb.pl line 18.

        This version 14.04.2 LTS if you can run it and tell me if works fine I will appreciateUbuntu version