Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^6: How can I import text to Access

by Broggy69 (Novice)
on May 28, 2015 at 20:07 UTC ( #1128184=note: print w/replies, xml ) Need Help??


in reply to Re^5: 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; 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

Replies are listed 'Best First'.
Re^7: How can I import text to Access
by GotToBTru (Prior) on May 28, 2015 at 20:14 UTC

    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://1128184]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2018-07-21 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (449 votes). Check out past polls.

    Notices?