Quick note: I have several Enterprise Access projects (.adp) that use a
combination of VBA and ADO for interfacing with Sql Server. You cannot
use DAO code in an ADP. You can only read data from sql server tables
in an Access ADP with ADO - com ADO. com ADO can also be used with
MDBs, but DAO is easier for reading data from Access mdb tables.
Although, I use com ADO in mdbs for reading/writing data to Excel files.
Plus, from Excel 2000 and forward, there is support for com ADO which is
real nice for using properties/ methods within Excel for reading data
from an Access mdb tables like
Dim cmd As New ADODB.Command, RS As New ADODB.RecordSet
cmd.ActiveConnection =
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Us er ID=;Data Source=" &
strPath
cmd.CommandType = adCmdText
cmd.CommandText = "Select * From tbl1"
Set RS = cmd.Execute
Range("A1").CopyFromRecordset RS
'--also works great with Sql Server tables - just different connection
string
For .Net project (VB, C#) you use ADO.Net. The big difference between
ADO.Net and com ADO is that ADO.Net is object oriented and you can do
stuff like this (for sql Server):
Imports System.Data.SqlClient (VB.Net)
Use System.Data.SqlClient (C#)
...
Dim cmd = New SqlCommand("Select * From tbl1, conn)
or for Access it would be
Imports System.Data.OleDb (VB)
Use System.Data.OleDb (C#)
...
Dim cmd = New OleDBCommand("Select * From tbl1, conn)
And a quick plug for VS.Net - VB still uses a lot of classic VB syntax,
but a lot of statements are interchangeable with C#. The big difference
between C# and VB.net is that C# uses a lot of Brackets{} and
semicolons. Otherwise, they have the same amount of functionality, both
use delegates, interfaces, and the rest of OOP stuff. C# is just a
little bit lower level - a little more granular than VB.Net (you can
fine tune a C# app a little more than VB.Net). Just remember, that the
thing with VB/VB.Net is RAPID APPLICATION DEVELOPMENT. There is nothing
faster than any form of VB for rapdid application development -
asp/aspx, exe, dll projects, interfacing with Sql
Server/Oracle/Mainframes...
There is no more ADODB in ADO.Net
Rich
*** Sent via Developersdex
http://www.developersdex.com ***