Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^6: How can I import text to Access

by Broggy69 (Novice)
on May 28, 2015 at 20:07 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1128184]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-24 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found