in reply to Re^3: How can I import text to Access
in thread How can I import text to Access
#!/usr/bin/perl use strict;use warnings; use Win32::OLE; my $DBFile = 'W:/Glenn-123456/Test/DevComm1.mdb' #my $DBFile = qw( W:\\Glenn-123456\\Test\\DevComm1.mdb ); #my $MSACCESS_DSN ='Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$DBF +ile ;Persist Security Info=False;'; #my $msaccess_dbh = DBI->connect("dbi:ODBC:$MSACCESS_DSN"); #Choose appropriate version of Jet for your system my $Jet = Win32::OLE->CreateObject('DAO.DBEngine.36') or die "Can't +create Jet database engine."; my $DB = $Jet->OpenDatabase( $DBFile ); my $SQLquery = "SELECT * INTO [Input] FROM [Text;DATABASE=W:\Glenn-123 +456\Test\;HDR=No].[DevComm1.txt]"; $DB->Execute($SQLquery, 128); #128=DBFailOnError #Still no look. tried a few things that are commented out. #But I have + new errors. #Unrecognized esape \G & \T line 14 #Syntax error line 12 near "my " #Global symbol "$Jet" requires explicit package name line 12 #Global symbol "$Jet" requires explicit package name line 13 #Global symbol "$DBFFile" requires explicit package name #line 13
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: How can I import text to Access
by GotToBTru (Prior) on May 28, 2015 at 20:01 UTC | |
by Broggy69 (Novice) on May 28, 2015 at 20:07 UTC | |
by GotToBTru (Prior) on May 28, 2015 at 20:14 UTC | |
by Broggy69 (Novice) on May 28, 2015 at 20:24 UTC |
In Section
Seekers of Perl Wisdom