[mso] Re: Access and ADO

  • From: "Dian Chapman" <dian@xxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Sat, 8 Nov 2003 15:07:40 -0600

To be honest with you Lisa...I'm not quite sure what it is you're doing. 

Okay...I understand that you want to use a CSV file as a DB representation.
But I never used DAO...so I'm not sure what you needed to connect to it with
DAO (I got into this just as DAO was going out the door, so I jumped on the
ADO bandwagon to learn cos' it seemed easier to do). 

In DAO did you need to provide the code for the "provider" you'd be using?
If so...what provider are you using??? I've only worked with Access and SQL
DBs so I'd use the JET provider for Access DBs:
"Provider=Microsoft.Jet.OLEDB.4.0;" or the SQL provider for those DBs (don't
have that one handy...as I just happen to be writing ASP/ADO code right now
to finalize my contest pages for TechTrax...using JET).

Post the code you are using to open and query it...maybe I can see something
within that that is causing an error.

NOTE...the book *I* recommend to learn ADO is the first book I used...which
made it all make sense: ADO for Dummies! You can find a link to it on my
recommended books web site at www.mousetrax.com/books.html#ado.

And this is a great learning source for web coding: (click the W3Schools)
http://www.mousetrax.com/Resources.html#learning

Was the PERMISSIONS error specific to permissions on your system? 

Did you create a DSN ODBC connection to the DB? That may have something to
do with permissions? It's much easier to create a DSN-less connection with
ADO...which is what I always use...so I've never bothered messing with the
DSN ODBC setting in the control panel, but once...and realized I needed to
find an easier way...hence DSN-less. See
http://www.w3schools.com/ado/ado_connect.asp

And yes, a LOG file probably isn't recognized as a viable DB source? But a
TXT file would be.

Well...yes, it SHOULD be updated as live. But I don't know for sure cos'
I've never done anything this way with a log file. I've only used true DBs. 

Example...my TechTrax database on my web site. Yes, whenever someone new
enters a subscription, I can instantly see the latest info, if I want, via
my live connection to the web DB. 

OR...(to keep out of OT<g>)...say you put this into an Access DB and had it
linked via ADO to a Word form. If, say, some other source had access to add
data to the DB via some other means...at any time you could open your Word
form and retrieve the latest data...depending on how you had it set up.

You might want to also check out my ADO code in a Word <--> AccessDB sample
I have on my site. Go to www.mousetrax.com/techpage.html#autoforms and note
the # 5 article in the Please fill out this form series of article I have
(near the bottom of that list). Click the Download to go to another page, I
believe, and then download the sample. You can open the form in Word and hit
Alt/F11 to view the connection code. If you read the article and set the
path to: c:\ComputorCompanion and set the proper ADO reference in the VBE
panel...the DB will work and you can add new data to the DB via the Word
form.

Hope SOMETHING in here helps! ;-)

Dian D. Chapman
Technical Consultant, 
Microsoft MVP & Instructor

Free Tutorials: www.mousetrax.com/techtrax
Free Word Tips & Tricks eBook: www.mousetrax.com/books.html
Learn VBA the easy way, thru video! www.mousetrax.com/techcourses.html

  


-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of Green
Sent: Friday, November 07, 2003 3:59 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Access and ADO

Hi Dian,

First off, Thank you for replying.

I've used dao for a long time now and I know I'm 200 years too late but I'm
trying to use ado for this. I guess I'll get around to .net in another 200
years :-)

I have a comma delimited txt file coming out of a non office application...
actually autocad. It's produced automatically as part of the plot/print
process. Once in access my plan is to use queries to base reports on.

I'm Sorry if this is outside of group scope and I'll keep looking elsewhere
if it is... apologies.

So anyway, I'm trying to read it as a recordset in ado. My first
question/problem is... I can connect to the record set but when I try to
open it with an sql select * from file, I get can't work with the record
set...(translation from Dutch) "-2147217911 (80040e00". A web search says
that this is because of permissions. This is an XP home stand alone computer
and I'm stuck.

The trick is... this seems to be because the file has a .LOG extension. If I
copy the log file and change it to a .TXT file then the sql works fine.

I *can* read the data with dao, but one of the reasons I'm trying to use dao
is because of future web stuff.

My second question is... is this a good idea? I'm not really all that sure.
Part of the thinking is to make the data "live"... that is the recordset
would be updated everytime the log file was written to...
but really I just don't know enough.

Any help or thoughts would be appreciated.

... and thankyou again.

Regards
Lisa

> -----Original Message-----
> From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx]On
> Behalf Of Dian Chapman
> Sent: 07 November 2003 20:36
> To: mso@xxxxxxxxxxxxx
> Subject: [mso] Re: Access and ADO
>
>
>
> I use ADO/SQL/VBS all the time...whatcha need?
>
> And yes, this IS within the scope of this group IF used within 
> Office...just like VBA.
>
> --------------------------------------------
> Dian D. Chapman

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to mso-request@xxxxxxxxxxxxx
with the word "unsubscribe" (without the quotes) in the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also
allow you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation
with instructions.  Once you are a member of the files group, you can go
here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: