Similar Threads:
1.DAO or ADO in Windows 2000, which to choose?
Hi guys,
I noticed when I tried to create a Database object in VBA, that VB had no
idea what i was talking about. I figured it would be another reference issue
but i couldnt think why such a default library would be missing. So I
discovered that ADO, which doesnt have a database object, is referenced by
default and you have to explicitly reference DAO 3.6 to get access to the
required objects.
I have two questions. How come ADO is used now instead of DAO and should I
be using ADO instead?
Also, in as few words as possible (i'm not expecting a whole article on it
:-), how do you access database tables using ADO.
Does anyone have a decent resource that describes ADO in terms of VBA
explicitly?
Thanks everyone
Kindest Regards
Simon
2.ADO versus DAO and Windows 2000
A few weeks ago I was asking about the performance of ADO against an
Access 97 mdb, and later, taking advice, I implemented DAO to compare.
However, now I have had occasion to test my project on Windows 2000
and the performance is way, way better with ADO. Same VB6 program,
same CPU/Mobo, same query, same database. The only thing that is
different is that the W2K PC has 1gb of RAM whereas my standard Win
98SE PC has 512mb.
Is the performance increase due to W2K being a fundamentally different
OS, maybe using threads automatically, or other 'speed up' tricks?
Could the extra RAM make such a huge difference. I'm talking about 25
secs on the Win 98SE box and 3 secs on the W2K PC.
MM
3.ADO vs DAO How to get the dialog to add/select ODBC DSN Connect in
What is the equivalent ADO code to open the ODBC dialog which allows a user
to select or create and then select the DSN of an ODBC data source.
In earlier versions of Access, using DAO the following code is used.
public function fnGetODBCConnect () as string
Dim wrkODBC As Workspace
Dim conPubs As Connection
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "", dbUseODBC)
Set conPubs = wrkODBC.OpenConnection("Connection", dbDriverPrompt, True,
"ODBC;DSN=MyDSN;")
fnGetODBCConnect = conPubs.Connect
Exit Function
Which would open up the ODBC dialog for creating/selecting a DSN and allow
me to get the connect string to an ODBC data source.
In all of the examples of ADO connections, all they show is keying in the
connect string which is not what I need.
--
Larry
4.DAO to ADO and Finding records
I have the following code that works fine in DAO but when change to ADO it
fails and I've run out of ideas to try. And pointers please.
Private Sub FindCourse(varCourse As Variant)
Dim LV As Variant
Dim rec As DAO.Recordset ' I change this to ADODB.recordset
Dim strBookmark As String
LV = Trim(varCourse)
If IsNull(varCourse) Then
MsgBox "No Record Found", vbInformation, "Error!"
Exit Sub
End If
'If Me.Dirty Then
'Me.Dirty = False
'End If
Forms!CourseDetails.SetFocus
DoCmd.GoToControl Forms!CourseDetails!Field94.Name
Set rec = Forms!CourseDetails.RecordsetClone
rec.FindFirst "[CourseCounter] = " & CLng(LV) ' & """" 'CStr()
If Not rec.NoMatch Then ' Change to If rec.EOF Then
strBookmark = rec.Bookmark
Forms!CourseDetails.Bookmark = strBookmark
End If
DoCmd.GoToControl Forms!CourseDetails!Field94.Name
DoCmd.Close A_FORM, "fdlgFind"
rec.Close
End Sub
5.DAO or ADO
I use Word as the user interface for accessing, searching and updating
databases. Up to now I've stored the data in Excel workbooks but the problems
there are multiple access and some trouble getting Excel to quit properly
(apparently a known 'bug').
First question: is mdb the best database format to use in this case ?
Second question: what method should I use for calling up the database from
VBA ? The examples I've found here seem to tend towards DAO but I've found
lots of references on the web to ADO being better, faster, easier to program
etc. Since my experience with either is limited, I'm prepared for some long
hours of studying but I want to know which to concentrate on for automation
from Word.
Any advice, anecdotes, links that could help me make up my mind ?
--
David M
WinXP - Office2003 (Italian)
6. Problem with searh ADO in Active directory on Windows 2000 server
7. Problem with search ADO in Active directory on Windows 2000 server
8. ADO 2.8 on Windows Server 2000?