Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
After executing this code, The Access DB and table is created, but the fields are not created. Can Anyone help me with this? What am i doing wrong?# !/usr/bin/perl -w use strict; use warnings; use Win32::OLE; use Win32::OLE::Const; my $dbname = 'c:/Perlscripts_Conv_Issues/mk-db/new.mdb'; if (-e $dbname) { unlink $dbname } my $catalog = Win32::OLE->new('ADOX.Catalog'); $catalog->Create('Provider=Microsoft.Jet.OLEDB.3.51;'. 'Data Source='.$dbname) || die "unable to create d +atabase - ".Win32::OLE->LastError; my $tblNEW = Win32::OLE->new('ADOX.Table'); $tblNEW->{Name} = "Contacts"; print "created table \n"; $tblNEW->Columns->Append("FirstName", 'adVarWChar'); $tblNEW->Columns->Append("LastName", 'adVarWChar'); $catalog->Tables->Append($tblNEW); $tblNEW = undef; $catalog = undef;
jsprat - you outlined this solution for me in my previous message. Maybe you can figure this one out? Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Create a MS Access database programmatically in perl
by jsprat (Curate) on Jul 07, 2003 at 18:20 UTC | |
|
Re: Create a MS Access database programmatically in perl
by Grygonos (Chaplain) on Jul 07, 2003 at 18:01 UTC | |
by jsprat (Curate) on Jul 07, 2003 at 23:01 UTC |