473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Importing DAO into .NET Project

Someone in the Access forum explained that I could retrieve metadata from
Access with the DAO API. I specifically what to retrieve the comments for
each column and table. I also want to retrieve the control associated with
each column in MSAccess.

When I fired up VS.NET to start the project, I could not find the DAO to
import! Where is it? I assume it is a COM interface. I think there is a C
interface too for DAO -- what is that called? Is there a native .NET
interface too?

Thanks,
Siegfried
Jul 21 '05 #1
11 8494
DAO has been a dead technology for over 5 years.
ADO replaced DAO.
While you can make a COM reference in .NET to the ADO library, .NET's native
database connection technology is ADO.NET.
"Siegfried Heintze" <si*******@heintze.com> wrote in message
news:u6*************@TK2MSFTNGP10.phx.gbl...
Someone in the Access forum explained that I could retrieve metadata from
Access with the DAO API. I specifically what to retrieve the comments for
each column and table. I also want to retrieve the control associated with
each column in MSAccess.

When I fired up VS.NET to start the project, I could not find the DAO to
import! Where is it? I assume it is a COM interface. I think there is a C
interface too for DAO -- what is that called? Is there a native .NET
interface too?

Thanks,
Siegfried

Jul 21 '05 #2
Seigfried,
While it is best to use ADO.NET in preference to ADO and it is better to use
ADO than DAO, DAO is still around. We just don't know for how long because
it is an obsolescent technology - it may be dying but it's not dead yet.

For properties of tables and columns, you'd be better off looking at the
System.Data.DataTable and System.Data.DataColumn objects in VS.NET if you're
starting from scratch - that's the direction things are going. I'm not sure
if AdoDotAnything will retrieve the property for the "Display Control" of an
Access table - I haven't tried that.

However, if you need to port DAO into .NET, you should be able to do it. I
can see a COM reference to "Microsoft DAO 3.6 Object Library" as well as
references to earlier versions of DAO when I add a reference to a VB.NET
project. If you have the file "C:\Program Files\Microsoft
Shared\DAO\dao360.dll", for example, on your PC but it's not showing up as a
COM reference, it's just not registered properly.

Hope this helps,
David Straker

"Scott M." <s-***@badspamsnet.net> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
DAO has been a dead technology for over 5 years.
ADO replaced DAO.
While you can make a COM reference in .NET to the ADO library, .NET's native database connection technology is ADO.NET.
"Siegfried Heintze" <si*******@heintze.com> wrote in message
news:u6*************@TK2MSFTNGP10.phx.gbl...
Someone in the Access forum explained that I could retrieve metadata from Access with the DAO API. I specifically what to retrieve the comments for each column and table. I also want to retrieve the control associated with each column in MSAccess.

When I fired up VS.NET to start the project, I could not find the DAO to
import! Where is it? I assume it is a COM interface. I think there is a C interface too for DAO -- what is that called? Is there a native .NET
interface too?

Thanks,
Siegfried


Jul 21 '05 #3

For properties of tables and columns, you'd be better off
looking at the System.Data.DataTable and
System.Data.DataColumn objects in VS.NET if you're
starting from scratch - that's the direction things are
going. I'm not sure if AdoDotAnything will retrieve
the property for the "Display Control" of an
Access table - I haven't tried that.


I've tried that -- did I miss something? I wrote a program that used a
treeview view to display everything I could find in the DataTable and
DataColumn and I could not find the MSAccess specific metadata like the
comments for the table and the columns and the control type used for
each column.

This does not surprise me -- why would a generic API have MSAccess
specific stuff. I also tried using ADOX and could get some but not all
of the metadata.

MSAccess is the only database (that I know of) that lets you store a
control (checkbox, dropdown list, etc...) for each column you define.

So why do you say DAO is going away? I hope not! It is the only way of
doing MSAccess specific stuff! Is there a better API for MSAccess
specific stuff? That would be nice! Or should I infer from you statement
that MSAccess is not dead yet but dying?

Thanks,
Siegfried

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #4
I cannot find "C:\Program Files\Microsoft
Shared\DAO\dao360.dll", on my computer because I don't have a
"Microsoft Shared" directory. Where else might I look for it?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #5
I found it!

It is in C:\Program Files\Common Files\Microsoft Shared\DAO

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #6
Siegfried,

I disagree with David. DAO is a dead technology, it's not going away, it's
already gone. MS doesn't support it (and hasn't for quite some time) and
there have been 2 new generations of data accessing technologies since DAO.

As for your comment that it is the only way of doing MS Access specific
stuff, that's not true at all.

In .NET, you could connect to an Access DB like this:

Dim conStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("db.mdb")
Dim sqlStr As String = "Select ....ORDER BY ...."

Dim con As OleDb.OleDbConnection
Dim cmd As OleDb.OleDbCommand

con = New OleDb.OleDbConnection(conStr)
cmd = New OleDb.OleDbCommand(sqlStr, con)

con.Open()

Now, once you have your connection object open, you can do many things, use
a DataReader (for read only - connected - forward only access), use a
dataSet, use a datatabe, a dataview, etc.

-Scott

"Siegfried Heintze" <si*******@heintze.com> wrote in message
news:e8*************@TK2MSFTNGP10.phx.gbl...

For properties of tables and columns, you'd be better off
looking at the System.Data.DataTable and
System.Data.DataColumn objects in VS.NET if you're
starting from scratch - that's the direction things are
going. I'm not sure if AdoDotAnything will retrieve
the property for the "Display Control" of an
Access table - I haven't tried that.


I've tried that -- did I miss something? I wrote a program that used a
treeview view to display everything I could find in the DataTable and
DataColumn and I could not find the MSAccess specific metadata like the
comments for the table and the columns and the control type used for
each column.

This does not surprise me -- why would a generic API have MSAccess
specific stuff. I also tried using ADOX and could get some but not all
of the metadata.

MSAccess is the only database (that I know of) that lets you store a
control (checkbox, dropdown list, etc...) for each column you define.

So why do you say DAO is going away? I hope not! It is the only way of
doing MSAccess specific stuff! Is there a better API for MSAccess
specific stuff? That would be nice! Or should I infer from you statement
that MSAccess is not dead yet but dying?

Thanks,
Siegfried

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #7
Seigfried,
Sorry I gave you the wrong folder for the DAO dll - late night stupidity I
think.

There are a lot of indicators that DAO is being phased out. The absence of a
..NET assembly for DAO in VS.NET is a pretty good indicator in itself of the
direction that Microsoft is going. I also agree that there are aspects of
the Access schema that are way beyond any other - like the ability to define
the default control for a column. But it looks like we're being strongly
encouraged to move away from DAO. I seem to remember coming across some info
in that line earlier this year but I can't remember where - probably the
Microsoft web site. As far as Access is concerned, I don't see it as
obsolescent technology and I've heard nothing along those lines. imho I
think its a work of genius. In fact, the Microsoft Access Product Team are
currently calling for input to make sure that mdb conversion to the next
version is as robust as possible.

I've only written schema interrogators using ADOX and ADO.NET primarily for
data validation routines prior to database updates. Things like "is the
user's data valid based on the schema definition for the column" so I
haven't delved into the extended column properties like "description" or
"default control". I'll give it a try when I have some time over the next
few days and let you know what I find.

David Straker

"Siegfried Heintze" <si*******@heintze.com> wrote in message
news:e8*************@TK2MSFTNGP10.phx.gbl...

For properties of tables and columns, you'd be better off
looking at the System.Data.DataTable and
System.Data.DataColumn objects in VS.NET if you're
starting from scratch - that's the direction things are
going. I'm not sure if AdoDotAnything will retrieve
the property for the "Display Control" of an
Access table - I haven't tried that.


I've tried that -- did I miss something? I wrote a program that used a
treeview view to display everything I could find in the DataTable and
DataColumn and I could not find the MSAccess specific metadata like the
comments for the table and the columns and the control type used for
each column.

This does not surprise me -- why would a generic API have MSAccess
specific stuff. I also tried using ADOX and could get some but not all
of the metadata.

MSAccess is the only database (that I know of) that lets you store a
control (checkbox, dropdown list, etc...) for each column you define.

So why do you say DAO is going away? I hope not! It is the only way of
doing MSAccess specific stuff! Is there a better API for MSAccess
specific stuff? That would be nice! Or should I infer from you statement
that MSAccess is not dead yet but dying?

Thanks,
Siegfried

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #8
On Tue, 23 Sep 2003 17:55:11 -0600, "Siegfried Heintze" <si*******@heintze.com> wrote:

¤ Someone in the Access forum explained that I could retrieve metadata from
¤ Access with the DAO API. I specifically what to retrieve the comments for
¤ each column and table. I also want to retrieve the control associated with
¤ each column in MSAccess.
¤
¤ When I fired up VS.NET to start the project, I could not find the DAO to
¤ import! Where is it? I assume it is a COM interface. I think there is a C
¤ interface too for DAO -- what is that called? Is there a native .NET
¤ interface too?
¤

You may also want to try GetOleDbSchemaTable before reverting to DAO or ADOX:

HOW TO: Retrieve Schema Information by Using GetOleDbSchemaTable and Visual Basic .NET
http://support.microsoft.com/default...Product=adonet
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #9
Siegfried,
I can't find any way of retrieving Access-specific column properties (like
the control associated with the Access column) in ADO.NET. It may be
possible but I can't see it. I can infer one in code, from data type,
foreign keys, etc. in ADO.NET but that's pretty laborious. Sorry I couldn't
help, dude.

Will somebody from Microsoft please step in and give the facts to Scott M.
on support for DAO. He's posting the same statements about it not being
supported for 5 years in at least one other forum. I know that the big move
is towards ADO.NET but DAO is in Windows XP which is the most recent version
of Access, Access XP is supported by Microsoft therefore DAO is supported by
Microsoft. Isn't that "Logic 101"?

David Straker

"Siegfried Heintze" <si*******@heintze.com> wrote in message
news:u6*************@TK2MSFTNGP10.phx.gbl...
Someone in the Access forum explained that I could retrieve metadata from
Access with the DAO API. I specifically what to retrieve the comments for
each column and table. I also want to retrieve the control associated with
each column in MSAccess.

When I fired up VS.NET to start the project, I could not find the DAO to
import! Where is it? I assume it is a COM interface. I think there is a C
interface too for DAO -- what is that called? Is there a native .NET
interface too?

Thanks,
Siegfried

Jul 21 '05 #10

"David Straker" <ds******@adelphia.net> wrote in message
news:eV**************@TK2MSFTNGP09.phx.gbl...
Siegfried,
I can't find any way of retrieving Access-specific column properties (like
the control associated with the Access column) in ADO.NET. It may be
possible but I can't see it. I can infer one in code, from data type,
foreign keys, etc. in ADO.NET but that's pretty laborious. Sorry I couldn't help, dude.

Will somebody from Microsoft please step in and give the facts to Scott M.
on support for DAO. He's posting the same statements about it not being
supported for 5 years in at least one other forum. I know that the big move is towards ADO.NET but DAO is in Windows XP which is the most recent version of Access, Access XP is supported by Microsoft therefore DAO is supported by Microsoft. Isn't that "Logic 101"?
David, try to understand what I'm saying:

There is a difference between providing a technology for backwards
compatibilty and supporting it. MS has not supported DAO in years. By
support, I mean respond to technical inquiries about it or build new
applications using it. I don't mean include it in a product that always had
it.

If you were to call MS and ask them for support with some aspect of DAO,
they would tell you that they no longer support technical inquiries on DAO
and point you to some MSDN article perhaps.

Above you write: "Windows XP which is the most recent version of Access...".
Umm, no. WindowsXP is the most recent version of Windows (home use).
AccessXP is not a part of Windows, nor does it come with WindowsXP.

You wrote: "Access XP is supported by Microsoft therefore DAO is supported
by Microsoft. Isn't that "Logic 101"?"
Umm, no. AccessXP may allow you to use DAO (I actually don't think it will,
but haven't tried it), but it's native data technology is ADO (as it was as
well in Access 2000).

My entire point Dave is that DAO is the road backwards, you can still walk
it if you like, but MS has had a new road in place for many years now (ADO)
and they even have a newer one (2 years+ already) ADO.NET.

You misunderstand "support" for "can use".


David Straker

"Siegfried Heintze" <si*******@heintze.com> wrote in message
news:u6*************@TK2MSFTNGP10.phx.gbl...
Someone in the Access forum explained that I could retrieve metadata from Access with the DAO API. I specifically what to retrieve the comments for each column and table. I also want to retrieve the control associated with each column in MSAccess.

When I fired up VS.NET to start the project, I could not find the DAO to
import! Where is it? I assume it is a COM interface. I think there is a C interface too for DAO -- what is that called? Is there a native .NET
interface too?

Thanks,
Siegfried


Jul 21 '05 #11

"David Straker" <ds******@adelphia.net> wrote in message
news:eV**************@TK2MSFTNGP09.phx.gbl...
Siegfried,
I can't find any way of retrieving Access-specific column properties (like
the control associated with the Access column) in ADO.NET. It may be
possible but I can't see it. I can infer one in code, from data type,
foreign keys, etc. in ADO.NET but that's pretty laborious. Sorry I couldn't help, dude.

Will somebody from Microsoft please step in and give the facts to Scott M.
on support for DAO. He's posting the same statements about it not being
supported for 5 years in at least one other forum. I know that the big move is towards ADO.NET but DAO is in Windows XP which is the most recent version of Access, Access XP is supported by Microsoft therefore DAO is supported by Microsoft. Isn't that "Logic 101"?
David, try to understand what I'm saying:

There is a difference between providing a technology for backwards
compatibilty and supporting it. MS has not supported DAO in years. By
support, I mean respond to technical inquiries about it or build new
applications using it. I don't mean include it in a product that always had
it.

If you were to call MS and ask them for support with some aspect of DAO,
they would tell you that they no longer support technical inquiries on DAO
and point you to some MSDN article perhaps.

Above you write: "Windows XP which is the most recent version of Access...".
Umm, no. WindowsXP is the most recent version of Windows (home use).
AccessXP is not a part of Windows, nor does it come with WindowsXP.

You wrote: "Access XP is supported by Microsoft therefore DAO is supported
by Microsoft. Isn't that "Logic 101"?"
Umm, no. AccessXP may allow you to use DAO (I actually don't think it will,
but haven't tried it), but it's native data technology is ADO (as it was as
well in Access 2000).

My entire point Dave is that DAO is the road backwards, you can still walk
it if you like, but MS has had a new road in place for many years now (ADO)
and they even have a newer one (2 years+ already) ADO.NET.

You misunderstand "support" for "can use".


David Straker

"Siegfried Heintze" <si*******@heintze.com> wrote in message
news:u6*************@TK2MSFTNGP10.phx.gbl...
Someone in the Access forum explained that I could retrieve metadata from Access with the DAO API. I specifically what to retrieve the comments for each column and table. I also want to retrieve the control associated with each column in MSAccess.

When I fired up VS.NET to start the project, I could not find the DAO to
import! Where is it? I assume it is a COM interface. I think there is a C interface too for DAO -- what is that called? Is there a native .NET
interface too?

Thanks,
Siegfried


Jul 21 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Awah Teh | last post by:
I am working on a project that involves importing IIS Log files into a SQL Server database (and these logfiles are big --> Some up to 2GB in size). Up until now I thought that DTS or the BULK...
9
by: Edward S | last post by:
I budget for a Project in an Excel sheet as illustrated below. The months below are usually a 2 year period i.e. 24 months, though it could be over 24 months depending upon a Project. I then...
1
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
5
by: Howard Kaikow | last post by:
I have files to build a C project, including the makefile, what's the easiest way to import the project into C and C# in VS .NET Professional? I have both VS .NET 2002 and 2003. I have nothing...
1
by: em | last post by:
Hi all, I'm getting some problems importing a DLL that I made in C# within VB6.0. The C# is quite easy, just for trying: namespace TestDll { public class Class1
0
by: Alun Jones | last post by:
I'm getting the above error in a dialog box from Visual Studio 2005 when trying to sign an assembly using a PFX file, and would like to know how to resolve the problem. Background: The PFX...
12
by: JMO | last post by:
I can import a csv file with no problem. I can also add columns to the datagrid upon import. I want to be able to start importing at the 3rd row. This will pick up the headers necessary for the...
5
by: Ronny | last post by:
I need to import the Winform GUI from one project to another(with all the controls). Is there a simple way to copy&paste it or must I create every control by hand Regards Ronny
7
by: Hussein B | last post by:
Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the sys module will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.