Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^5: How can I import text to Access

by GotToBTru (Prior)
on May 28, 2015 at 20:01 UTC ( #1128183=note: print w/replies, xml ) Need Help??


in reply to Re^4: How can I import text to Access
in thread How can I import text to Access

Missing ; at the end of the my $DBFile line.

Dum Spiro Spero

Replies are listed 'Best First'.
Re^6: How can I import text to Access
by Broggy69 (Novice) on May 28, 2015 at 20:07 UTC
    #!/usr/bin/perl use strict; use warnings; use Win32::OLE; my $DBFile; my $Jet; my $DB; my $SQLquery; $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; $Jet = Win32::OLE->CreateObject('DAO.DBEngine.36') or die "Can't cre +ate Jet database engine."; $DB = $Jet->OpenDatabase( $DBFile ); $SQLquery = "SELECT * INTO [Input] FROM [Text;DATABASE=W:/Glenn-123456 +/Test/;HDR=No].[DevComm1.txt]"; $DB->Execute($SQLquery, 128); #128=DBFailOnError #Ok here is updated code, but still getting an error #Can't create Jet Database engine at line 17

      And now you're in the realm of OLE errors, and I can't help there (others here might). Perhaps Win32::OLE->LastError() contains some useful information?

      Dum Spiro Spero
        added Win32::OLE->LastError() no new information

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1128183]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2018-04-22 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?