Accessing MS Access

Hi all,

This is probably a more DB oriented question, but it came out of the =
DBI. I posted a question and have tried several solutions on how to open =
up an MS Access DB from the DBI::ODBC but so far have been unable to. =
What I had to end up doing was create a DTS that runs every 5 minutes =
which copies the table I need from Access and populates a SQL Server =
table. This causes a delay on my web application such that whenever my =
page overlaps while the DTS is running I get no data. So I was wondering =
if there is a better way to get information from Access so I can see it =
on my CGI with DBI.

Regards,

Javier Moreno
0
JavierMoreno
4/8/2005 8:44:40 PM
perl.dbi.users 11100 articles. 1 followers. Follow

4 Replies
1302 Views

Similar Articles

[PageSpeed] 20

> From: "Moreno, Javier" <JavierMoreno@eaton.com>
> Date: 2005/04/08 Fri PM 03:44:40 CDT
<snip>
> I posted a question and have tried several solutions on how to open 
> up an MS Access DB from the DBI::ODBC but so far have been unable to. 
<snip>
> I was wondering if there is a better way to get information 
> from Access so I can see it on my CGI with DBI.
<snip>

Well, I've posted several times (the last time was in a reply to a 
thread that you started) that you should use ADO to connect to your 
Access database, and I gave you connection examples.  So, I guess the 
answer is yes, there may indeed be a better way to connect to your 
Access database than with DBD::ODBC.  If not better, at least different.

http://www.nntp.perl.org/group/perl.dbi.users/26145

> Regards,
> Javier Moreno

HTH,
amonotod

--

    `\|||/         amonotod@    | sun|perl|windows
      (@@)         charter.net  | sysadmin|dba
  ooO_(_)_Ooo____________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|

0
amonotod
4/9/2005 1:06:42 AM
Ok. I have tried ADO as well with no luck. Please help!

<snip>

# Include CPAN modules for DB communication
use DBI;
#use DBD::ODBC;
use DBD::ADO;
#use Win32::OLE;

# Use these pragmas to code correctly
use strict;

# Include custom functions
require "Functions.pl";

# Debug
$::DEBUG=3D1;

# Connect to the database, return error message if something went wrong
my ($path_to_mdb_file) =3D '\\slpmxwtstandclu\testdata$\Data_2.mdb';
my ($dsn)=3D "Provider=3DMicrosoft.Jet.OLEDB.4.0;Data =
Source=3D$path_to_mdb_file";
&Debug("About to connect to $dsn");
#$::dbh =3D DBI->connect( =
"dbi:ADO::Provider=3DMicrosoft.Jet.OLEDB.4.0;Jet OLEDB:Engine =
Type=3D5;Data Source=3D$path_to_mdb_file" ,'admin', { AutoCommit =3D> 1} =
) or
$::dbh =3D DBI->connect("dbi:ADO:$dsn", 'Admin', '', { AutoCommit =3D> =
1} ) or
	&Error("Unable to connect to database.");

<endsnip>

With the first connection string I got:

[Mon Apr 11 14:23:42 2005] [error] [client 151.110.117.153] Usage: =
$class->connect([$dsn [,$user [,$passwd [,\\%attr]]]]) at =
C:/oracle/ora92/Apache/Apache/ITTWeb/cgi-bin/CLUCTR.pl line 63\r, =
referer: http://slpmxwmorenojav/ITTWeb/cgi-bin/Welcome.pl

while with the second I get:

[Mon Apr 11 14:29:57 2005] [error] [client 151.110.117.153] dbih_getcom =
given an undefined handle (perhaps returned from a previous call which =
failed) at C:/Perl/site/lib/DBI.pm line 598.\r, referer: =
http://slpmxwmorenojav/ITTWeb/cgi-bin/Welcome.pl

Regards,

Javier Moreno

-----Original Message-----
From: amonotod [mailto:amonotod@charter.net]
Sent: Friday, April 08, 2005 8:07 PM
To: Moreno, Javier; dbi-users@perl.org
Subject: Re: Accessing MS Access


> From: "Moreno, Javier" <JavierMoreno@eaton.com>
> Date: 2005/04/08 Fri PM 03:44:40 CDT
<snip>
> I posted a question and have tried several solutions on how to open=20
> up an MS Access DB from the DBI::ODBC but so far have been unable to.=20
<snip>
> I was wondering if there is a better way to get information=20
> from Access so I can see it on my CGI with DBI.
<snip>

Well, I've posted several times (the last time was in a reply to a=20
thread that you started) that you should use ADO to connect to your=20
Access database, and I gave you connection examples.  So, I guess the=20
answer is yes, there may indeed be a better way to connect to your=20
Access database than with DBD::ODBC.  If not better, at least different.

http://www.nntp.perl.org/group/perl.dbi.users/26145

> Regards,
> Javier Moreno

HTH,
amonotod

--

    `\|||/         amonotod@    | sun|perl|windows
      (@@)         charter.net  | sysadmin|dba
  ooO_(_)_Ooo____________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|

0
JavierMoreno
4/11/2005 7:35:04 PM
On Apr 11, 2005 12:35 PM, Moreno, Javier <JavierMoreno@eaton.com> wrote:
> Ok. I have tried ADO as well with no luck. Please help!
> 
> <snip>
> 
> # Include CPAN modules for DB communication
> use DBI;
> #use DBD::ODBC;
> use DBD::ADO;
> #use Win32::OLE;
> 
> # Use these pragmas to code correctly
> use strict;
> 
> # Include custom functions
> require "Functions.pl";
> 
> # Debug
> $::DEBUG=1;
> 
> # Connect to the database, return error message if something went wrong
> my ($path_to_mdb_file) = '\\slpmxwtstandclu\testdata$\Data_2.mdb';

Aha!
You are attempting to connect to a database on what looks like a network share.
My guess is this is probably not a Perl issue, but rather a network
authentication issue-
 Try to create an empty text file on  "'\\slpmxwtstandclu" from the
same account you're running your script from... If  you can, then my
guess is there's something funny going on in the Access DB.

But if you can't, then make sure the network account from which you
physically run the perl script has read/write permissions for the
network resource you are using.... and if you schedule this perl
script to run at a specific time,  you have to make sure the
definition of the scheduled task ALSO has the network authentication
parameters (user name / passwd) correct.

HTH-
kc
0
kevindotcar
4/11/2005 8:06:59 PM
> From: Kevin Carothers <kevindotcar@gmail.com>
> Date: 2005/04/11 Mon PM 03:06:59 CDT

> On Apr 11, 2005 12:35 PM, Moreno, Javier <JavierMoreno@eaton.com> wrote:
> > Ok. I have tried ADO as well with no luck. Please help!
<snip>
> > my ($path_to_mdb_file) = '\\slpmxwtstandclu\testdata$\Data_2.mdb';
> 
> Aha!
> You are attempting to connect to a database on what looks like a network share.
> My guess is this is probably not a Perl issue, but rather a network
> authentication issue-
<snip>
> But if you can't, then make sure the network account from which you
> physically run the perl script has read/write permissions for the
> network resource you are using...

Another way to test that theory, is copying your .mdb file over to a 
local path on the webserver, like \\webserver\c$\temp, then changing 
$path_to_mdb_file = "c:/temp/Data_2.mdb"

In case that is the issue, and you're running IIS, here you go:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q207671

HTH,
amonotod


--

    `\|||/         amonotod@    | sun|perl|windows
      (@@)         charter.net  | sysadmin|dba
  ooO_(_)_Ooo____________________________________
  _____|_____|_____|_____|_____|_____|_____|_____|

0
amonotod
4/11/2005 8:19:18 PM
Reply:

Similar Artilces:

Accessing MS Access through the DBI ODBC
Hi all, I am trying to access an MS Access database via perl DBI and I am unable = to. I checked the security and there is only one 'Admin' user with no = password and I use that in my connection string. However, I cannot = connect. Please help. Regards, Javier Moreno Hi Javier, > I am trying to access an MS Access database via perl DBI and I am unable to. I checked the security and there is only one 'Admin' user with no password and I use that in my connection string. However, I cannot connect. Please help. > 1. Create an ODBC connection via %Sys...

Dbi objects to access an MS Access Db
I'm having a problem getting Tran-ide to recognize my access 2000 database. I've created a system dsn called Midas and created the attached nnsyreg.dat file and put it into e:\sybase\ImpactClient-5_3\config directory. I've also put this file in my projects directory and still get the following message. Unable to connect to session Midas. Any Advice? Thanks Brent begin 666 nnsyreg.dat M4V5S<VEO;BY-:61A<PT*"4Y.3U1?4TA!4D5$7TQ)0E)!4ED@/2!D8G0R-VUS M;V1B8PT*"4Y.3U1?1D%#5$]265]&54Y#5$E/3B ]($Y.4V5S3T1"0T9A8W1O M<GD-"@E.3E]315-?4T525D52(#T@24U...

Single user access on MS Access database
We just transitioned our DATA volume from a Netware traditional volume to a iSCSI connected NSS volume on a NetApp Filer FAS 270. Netware 6.5 Since the move we've noticed a MS Access database issue arise. When the database is opened by the next user they receice the error message: "MSysAccessObjects can not be opened it is currently opened by another user" This is an Access file table not a custom table. Is it a Oplocks and/or File Caching issue on the server? If so, where can I tuen that off? Does anyone know of any issues regarding MS Access and NSS volu...

MS access to MS access problem
I always used MS Access Database In my programs, now I want to use SQL SERVER database and so I started to design one. but it’s a little bit confusing ,I don’t know what can I use in change of these access Data type : MS access // MS access -------------- -------------------- Memo >>>>>>>> ?? AutoNumber >>>>> ?? * and if you think there is some difference between Ms access and SQL in D...

Re: Re: Accessing MS Access through the DBI ODBC
> From: Kevin Carothers <kevindotcar@gmail.com> > Date: 2005/03/30 Wed PM 06:44:48 CST > 1. Create an ODBC connection via %SystemRoot%\system32\odbcad32.exe > Call the database connect name "ODBCName" > > 2. In your Perl code add: > [---] > use DBI; > [---] > $dbh = DBI->connect("dbi:ODBC:ODBCName",'',''); > [---] Just my opinion, but I don't think this is good advice. For one, it creates extra administration on the system, by forcing the user/programmer /sysadmin/webadmin to ...

accessing access
------=_NextPart_000_029B_01C29063.1E2098D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi! I am trying to access an access mdb file for the first time. I get the following error: Can't connect(dbi::ODBC:pfawtbls.mdb ), no database driver specified and DBI_DSN env var not set at jfa_data.pl line 147 for the code: my $dbh = DBI->connect( "dbi::ODBC:pfawtbls.mdb", "", "", ) or die "Unable to connect: ". $DBI::errstr. "<br>"; What am I missing? Thanks, Jer...

Access access
========== Hi, Everyone ... I'm going to lock this thread for now. If you have a question about working with Access in Web Matrix, please start a new thread in this forum. Otherwise, this thread will get to be unwieldy. Thanks! ========== Updated 6/29/03 Hello, everyone. I've been working with the new version of Web Matrix (version .6, build 812, available right now!). In particular, I've been playing with support for Microsoft Access, which is one of the great new features in the new release. I wrote up some notes on what I've found to share some of my experiences and to a...

DBI, MS Access, inserting/updating a Access Date/Time value
Hi, Does anyone have any idea what is up with Microsoft Access and its ridiculous Date/Time formatting options? It doesn't seem to matter what format I attempt to insert with. The directory and db file permissions are all Full Control. I'm using the "#" around the Date/Time format as required. The database has nothing as the Format in Design view on the General tab. The insert below has never worked once. On the up side if I run an insert that has no mention of the Date/Time field then it will just insert the record using the =Now() function as the default va...

accessing MS Access from .net
hi I am accessing ms access data base which has a table called customers. when i try to insert data into the table i am gettign the error like "Operation must use an updatable query" and the line its showing is myOleDbcommand.ExecuteNonQuery() here is my code in page lode event Sub Page_Load(Sender As Object, E As EventArgs) Dim StrConnectString as String Dim strStatement as String strConnectSTring = "Provider=Microsoft.Jet.OLEDB.4.0;Password='';User ID=Admin;Data Source=C:\Inetpub\wwwroot\Srinu\WebApplication2\...

DBD::Access? [was: MS Access]
The message further below went accidentally not to the list... > Tim Harsch wrote: > > Forgive my naivity (or just flawed understanding) but how would one go > about creating a DBD::Access? For instance DBD::Oracle is built on > OCI, does Access have a similar network protocol? I thought that ODBC > was about the only MS supported method of communicating to it... One of the earlier mails said: > > From: Tim Bunce > > On Tue, Jun 25, 2002 at 10:27:20AM -0700, Jeff Zucker wrote: > > > Orlando Andico wrote: > > > > > >...

Accessing a MS Access database
Hi, I would like to do a lookup into an Access database, and display the result in a grid. I'm an embedded programmer being thrown into the world of .net, asp, VB, and databases so I don't know where to start :-) ...... can anyone help me ? Thanks. Really jus ta matter of making a connection, doing your query, and displaying results. Here is a sample from a module I use. The data is bound to a datagrid. Sub LoadSchedule() Dim strSrc As String = CType(Settings("src"), String) If Trim(strSrc) <> "" Then ...

Access to MS-Access denied
I'm moving data from MS-Access *.mdb files (using Win32::ODBC) to a postgresql database (using DBD:Pg). While I'n not having problems to do it with many ordinary *.mdb files I'm unable now to transfer data from an Access file which is protected. As a matter of fact the launching icon on my NT desktop has the following line in it (which gives me r/w rights on the db): "C:\programs\Microsoft Office\Office\MSACCES.EXE""V:\PE\myfile.mdb/user De Martino/nostartup". I've tried to give the login "De Martino" (no password is required) to the ...

Users unable to delete records when accessing SQL 2005 tables via MS Access 2007
The background: we have a number of databases in SQL 2005, which our primary users access via MS Access 2007. For some reason, in some (but not all) newer tables in these databases, our users are unable to modify or delete records, even though the users have all the permissions they should need to do so. In one case, the user will get a message that someone else is accessing the same data at the time, even though nobody is. Another user gets no error message, her machine just beeps at her and does nothing. We're completely stuck - does anyone have any ideas as to what might be causi...

Help with script for accessing MS Access
I have an MS Acess 2002 database that has two tables: Article & Keyword Under Article, there's an ArticleID field that is tied to the name of an Article and file name Under Keyword, there's Keyword field that has keywords and then it's tied to an ArticleID field that ties it to the ArticleID field in the Article table. Basically, you have an article title name that has a bunch of keywords tied to that article (ID). I have the actual article stored in an ASPX file. Now, I need to have a search box so people can type in a keyword and respective articles will come up. This is wh...

Web resources about - Accessing MS Access - perl.dbi.users

Highest Percentage Of Opera Mini Users Accessing Facebook? Macau
If you were asked to guess which country had the highest percentage of users of Opera mobile Web browser Opera Mini users accessing Facebook ...

International Users Accessing Facebook Places Through US VPN Accounts
By using a virtual private network (VPN) hosted in the United States, Facebook users from around the world are accessing Facebook Places. The ...

What are some alternatives to Yodlee for accessing bank information?
Clay Loveless , Founder, Jexy. Co-founder, Mashery. Founder, Jexy. Co-founder, Mashery.

Cloud Console - Accessing files in cloud storage for iPad on the iTunes App Store
Get Cloud Console - Accessing files in cloud storage on the App Store. See screenshots and ratings, and read customer reviews.

Meryl Streep On Accessing The Characters Within - YouTube
Meryl Streep talks about the importance of an actors work representing their ability. CONNECT WITH AFI: http://facebook.com/AmericanFilmInstitute ...

Student pleads guilty to accessing records about Frances Abbott design scholarship
The Sydney student who leaked information about a fashion school scholarship controversially awarded to the daughter of the Prime Minister has ...

Accessing a headline opinion
Accessing a headline opinion

Sharp increase in authorities accessing private data
Australian law enforcement and government agencies have sharply increased their access without warrant to vast quantities of private telephone ...

Former librarian charged with accessing student records of Frances Abbott
A former part-time librarian at a Sydney design school has been charged after she allegedly accessed student records of Prime Minister Tony Abbott's ...

Frances Abbott scholarship: Sydney woman pleads guilty to accessing Whitehouse Institute records on PM's ...
A Sydney woman who leaked the student records of Tony Abbott's daughter pleads guilty. A Sydney woman who leaked the student records of Prime ...

Resources last updated: 1/22/2016 1:24:17 PM