Now's a fine time to ask but ADO or DAO?

D

dbahooker

Fred;

I'm sorry that you think that SQL Server is all big and complex

lose the fucking training wheels.

Companies that don't have the ability to 'develop in SQL Server' and
'move this to production' have NO ABILITY TO BE SUCCESSFUL IN THE
FUTURE.

Build your company on Jet; and you'll have capacity problems with a
mere 10mb of data

-Aaron
 
D

dbahooker

DAO isn't included in Access; it's not included as a default reference

there is an ADO connection built into every MDB database in the world..
it's called CurrentProject.connection

CurrentProject.connection.execute

Im so sorry that it's too complex for you.. you should lose the
training wheels you fucking newbie.

DAO causes crashes and hangs; you have to explicitly close everything--
it pretty much defeats the purpose of writing in VB.

Just because you've been working on databases with only 10 records in
them; that doesn't mean that Joe Q Public should use DAO.

DAO isn't included in half of the Windows desktops on the world!!!

How dare you think that it's appropriate to use this.

Lose the fucking training wheels kids; you DAO dipshits give us SQL
developers a bad name.


-Aaron
 
D

David W. Fenton

Thank you for your very sophisticated and informative answer.

Aaron is a well-known troll whose posts consist of variations on the
theme "MDBs suck." His comments about DAO are just wrong, period, as
is nearly everything he posts. Just ignore everything he says --
that's what everyone else does.
 
A

aaron.kempf

**** you mother fucking pig

you tell me.. does DAO ship with Windows?

Does it ship with MDAC?

eat a fucking dick you lamer

-Aaron
 
A

aaron.kempf

and for the record?

MSDE is a COMPONENT OF OFFICE ITS INCLUDED ON THE OFFICE DISK

just because you work for a backwards ass company and you're stuck in
the 90s; it doesn't mean that DAO is the right route.

DAO is for fucking retards.. Don't be stuck in the 90s.

-Aaron
 
A

Arvin Meyer [MVP]

Not too sure what happened here, but it sure is a mess. I put the code up on
my website, so you don't have to try and decypher the mess below:

http://www.datastrat.com/Code/FastLookup.txt
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Arvin Meyer said:
Jacob,

I commend you for your tenacity in developing this. I'm sure it was quite
a task putting all the formulas together to build this database. Someday,
I'd like to take a look at the way you did it.

The answer to your question became clear in the very last sentence of your
post. As soon as you used the word "DLookup" I knew that you could
probably increase the speed drastically. Here's some code I wrote to
replace DLookup almost 10 years ago, and updated last year. The idea was
given to me by Trevor Best who wrote a bunch of lookup replacement
functions for Access 2.0. This function is pretty generic, so you can use
it a lot.:

Public Function FastLookup(strFieldName As String, strTableName As String,
strWhere As String) As Variant
'*******************************************************************************************************
' Name: FastLookup ' Purpose: Fast replacement for DLookup ' Inputs:
strFieldName As String ' strTableName As String '
strWhere As String ' Returns: Variant ' Author: Arvin Meyer ' Date:
April 9, 1997 ' Updated: June 15, 2005 ' Usage: ' If
FastLookup("FieldName", "TableName", "FieldName ='" &Me.txtControlName &
"'") = Me.txtControlName Then ' MsgBox "This value exists. Please
choose again", vbOKOnly,"Duplicate!" ' Me.txtControlName.SetFocus '
Exit Sub ' End If '
'***************************************************************************************************************On
Error GoTo Error_HandlerDim db As DAO.DatabaseDim rst As DAO.RecordsetDim
Temp As VariantSet db = CurrentDb If strWhere = "" Then Set rst
= db.OpenRecordset("Select [" & strFieldName & "] From [" &strTableName &
"]", dbOpenSnapshot) Else Set rst = db.OpenRecordset("Select ["
& strFieldName & "] From [" &strTableName & "] Where " & strWhere,
dbOpenSnapshot) End If If Not rst.BOF Then rst.MoveFirst
Temp = rst(0) Else Temp = Null End If rst.Close
FastLookup = TempExit_Here: On Error Resume Next rst.Close Set
rst = Nothing Set db = Nothing Exit FunctionError_Handler: MsgBox
Err.Number & ": " & Err.Description Resume Exit_HereEnd Function--Arvin
Meyer, MCP,
MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com"JK"
messageArvin,> (Other
please feel free to replay)>> Whilst on the subject, I wander if I can
increase speed:>> I have a table that maintains holidays rules/date around
the world, 800records so far and growing. There are other "supporting"
tables needed, butlet leave it out for now.>> Background:> ------------->
Each holiday has its own rule. Some of the rules are simple (eg 25 Dec,
or> 4th Thursday in Nov), others are more involved (eg. if an holiday
falls ona> weekend, Move it to Monday). Yet others depend on another
holiday (eg. 46> days after Easter Sunday).>> In addition, each rule has
its own calendar (Gregorian, Hebrew, Islamic sofar) with or without a
cross-over, e.g Easter Sunday falls on the FirstSunday after the Jewish
Passover (with exceptions)>> I have the relevant routines to calculate the
fields "ThisYearDate" and"NextHolidayDate" (not always the same, "US
presidential Election" has Nullvalue in isYearDate" (2006) but has a value
in "NextHolidayDate", 4 Nov,2008), *NO PROBLEM* thus far.>> Each time a
user enter a record, through the OnCurrent event, those twodates get
updated through a combination of a Private and a Public Functions.The same
happens, through AfterUpdate event of any field that affects therule (Only
Admin can do that), still no problem there.>> Regardless of the calendar
used to calculate the holiday date, *both*"ThisYearDate" and
"NextHolidayDate" return the date in Gregorian calendar,eg. Jewish New
Year which is the first day of the year in the Hebrewcalendar will return
23 Sep 2006 (this year) and 13 Sept 2007 (next date)>> The
Problem> --------------> Once a year, soon after new year day, I run an
update query to update allthe dates in the table. That query runs for
about *15 minutes * with 800records, not surprising under the
circumstances described above.>> The Question
(finally)> ----------------------> Having written those a few years back
when I did not understand whatRecordset or DAO means, I wander whether I
should modify the routine for ayearly update to reduce the time of a full
update. I am in two minds:>> 1. If ain't broken, don't fix it> 2. If I can
speed up the operation dramatically using DAO, I can allowusers to do a
general update any time.>> Thus far all the calculations are done by
whatever DLookup()'s returns.Bearing in mind that if a holiday date is
linked to another holiday, thatother holiday has to be calculated first.>>
Appreciated your comments>> Regards> Jacob>>>> "Arvin Meyer [MVP]"
If you disambiguate, both
can be used. IMO, it would be DAO for most of>> the work. ADO is designed
to be faster with SQL-Server and for the most>> part it is. It does not
have all the functionality of DAO, but will dothe>> majority of what you
may need to do. ADO is not being developed any more>> in favor of ADO.NET.
The 2 are not alike. That alone would put a damperon>> my deployment
plans.>> -->> Arvin Meyer, MCP, MVP>> http://www.datastrat.com>>
http://www.mvps.org/access>> http://www.accessmvp.com>>>> "Fred Wilson"
Hello all,>>>>>> I
have an MS Access 2003 database that I use as a tool to manage some>>>
reports and data dumps from an oracle.>>>>>> Anyway, which is the better
records set to use, ADO or DAO and why?>>>>>> Thanks,>>> Fred>>>>>>>
 
A

aaron.kempf

a dependency to 'DAO' is ridiculous in a DLookup replacement

you should use ADO; jackass

-Aaron


Jacob,

I commend you for your tenacity in developing this. I'm sure it was quite a
task putting all the formulas together to build this database. Someday, I'd
like to take a look at the way you did it.

The answer to your question became clear in the very last sentence of your
post. As soon as you used the word "DLookup" I knew that you could probably
increase the speed drastically. Here's some code I wrote to replace DLookup
almost 10 years ago, and updated last year. The idea was given to me by
Trevor Best who wrote a bunch of lookup replacement functions for Access
2.0. This function is pretty generic, so you can use it a lot.:

Public Function FastLookup(strFieldName As String, strTableName As String,
strWhere As String) As Variant
'******************************************************************************************************* ' Name: FastLookup ' Purpose: Fast replacement for DLookup ' Inputs: strFieldName As String ' strTableName As String ' strWhere As String ' Returns: Variant ' Author: Arvin Meyer ' Date: April 9, 1997 ' Updated: June 15, 2005 ' Usage: ' If FastLookup("FieldName", "TableName", "FieldName ='" &Me.txtControlName & "'") = Me.txtControlName Then ' MsgBox "This value exists. Please choose again", vbOKOnly,"Duplicate!" ' Me.txtControlName.SetFocus ' Exit Sub ' End If ' '***************************************************************************************************************On Error GoTo Error_HandlerDim db As DAO.DatabaseDim rst As DAO.RecordsetDim Temp As VariantSet db = CurrentDb If strWhere = "" Then Set rst = db.OpenRecordset("Select [" & strFieldName & "] From [" &strTableName & "]", dbOpenSnapshot) Else Set rst = db.OpenRecordset("Select [" & strFieldName & "] From [" &strTableName & "] Where " & strWhere, dbOpenSnapshot) End If If Not rst.BOF Then rst.MoveFirst Temp = rst(0) Else Temp = Null End If rst.Close FastLookup = TempExit_Here: On Error Resume Next rst.Close Set rst = Nothing Set db = Nothing Exit FunctionError_Handler: MsgBox Err.Number & ": " & Err.Description Resume Exit_HereEnd Function--Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com"JK" <[email protected]> wrote in messagenews:[email protected]...> Arvin,> (Other please feel free to replay)>> Whilst on the subject, I wander if I can increase speed:>> I have a table that maintains holidays rules/date around the world, 800records so far and growing. There are other "supporting" tables needed, butlet leave it out for now.>> Background:> -------------> Each holiday has its own rule. Some of the rules are simple (eg 25 Dec, or> 4th Thursday in Nov), others are more involved (eg. if an holiday falls ona> weekend, Move it to Monday). Yet others depend on another holiday (eg. 46> days after Easter Sunday).>> In addition, each rule has its own calendar (Gregorian, Hebrew, Islamic sofar) with or without a cross-over, e.g Easter Sunday falls on the FirstSunday after the Jewish Passover (with exceptions)>> I have the relevant routines to calculate the fields "ThisYearDate" and"NextHolidayDate" (not always the same, "US presidential Election" has Nullvalue in isYearDate" (2006) but has a value in "NextHolidayDate", 4 Nov,2008), *NO PROBLEM* thus far.>> Each time a user enter a record, through the OnCurrent event, those twodates get updated through a combination of a Private and a Public Functions.The same happens, through AfterUpdate event of any field that affects therule (Only Admin can do that), still no problem there.>> Regardless of the calendar used to calculate the holiday date, *both*"ThisYearDate" and "NextHolidayDate" return the date in Gregorian calendar,eg. Jewish New Year which is the first day of the year in the Hebrewcalendar will return 23 Sep 2006 (this year) and 13 Sept 2007 (next date)>> The Problem> --------------> Once a year, soon after new year day, I run an update query to update allthe dates in the table. That query runs for about *15 minutes * with 800records, not surprising under the circumstances described above.>> The Question (finally)> ----------------------> Having written those a few years back when I did not understand whatRecordset or DAO means, I wander whether I should modify the routine for ayearly update to reduce the time of a full update. I am in two minds:>> 1. If ain't broken, don't fix it> 2. If I can speed up the operation dramatically using DAO, I can allowusers to do a general update any time.>> Thus far all the calculations are done by whatever DLookup()'s returns.Bearing in mind that if a holiday date is linked to another holiday, thatother holiday has to be calculated first.>> Appreciated your comments>> Regards> Jacob>>>> "Arvin Meyer [MVP]" <[email protected]> wrote in message> news:[email protected]...>> If you disambiguate, both can be used. IMO, it would be DAO for most of>> the work. ADO is designed to be faster with SQL-Server and for the most>> part it is. It does not have all the functionality of DAO, but will dothe>> majority of what you may need to do. ADO is not being developed any more>> in favor of ADO.NET. The 2 are not alike. That alone would put a damperon>> my deployment plans.>> -->> Arvin Meyer, MCP, MVP>> http://www.datastrat.com>> http://www.mvps.org/access>> http://www.accessmvp.com>>>> "Fred Wilson" <[email protected]> wrote in message>> news:[email protected]...>>> Hello all,>>>>>> I have an MS Access 2003 database that I use as a tool to manage some>>> reports and data dumps from an oracle.>>>>>> Anyway, which is the better records set to use, ADO or DAO and why?>>>>>> Thanks,>>> Fred>>>>>>>
 
J

JK

Many thanks Arvin,

Got it and will look at it.

I'm a happy for you to have the relevant DB, I sent it to your Datastart
mail address. Please let me know if received ok.

Regards
Jacob

Arvin Meyer said:
Not too sure what happened here, but it sure is a mess. I put the code up
on my website, so you don't have to try and decypher the mess below:

http://www.datastrat.com/Code/FastLookup.txt
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Arvin Meyer said:
Jacob,

I commend you for your tenacity in developing this. I'm sure it was quite
a task putting all the formulas together to build this database. Someday,
I'd like to take a look at the way you did it.

The answer to your question became clear in the very last sentence of
your post. As soon as you used the word "DLookup" I knew that you could
probably increase the speed drastically. Here's some code I wrote to
replace DLookup almost 10 years ago, and updated last year. The idea was
given to me by Trevor Best who wrote a bunch of lookup replacement
functions for Access 2.0. This function is pretty generic, so you can use
it a lot.:

Public Function FastLookup(strFieldName As String, strTableName As
String, strWhere As String) As Variant
'*******************************************************************************************************
' Name: FastLookup ' Purpose: Fast replacement for DLookup ' Inputs:
strFieldName As String ' strTableName As String ' strWhere As
String ' Returns: Variant ' Author: Arvin Meyer ' Date: April 9, 1997 '
Updated: June 15, 2005 ' Usage: ' If FastLookup("FieldName", "TableName",
"FieldName ='" &Me.txtControlName & "'") = Me.txtControlName Then '
MsgBox "This value exists. Please choose again", vbOKOnly,"Duplicate!" '
Me.txtControlName.SetFocus ' Exit Sub ' End If '
'***************************************************************************************************************On
Error GoTo Error_HandlerDim db As DAO.DatabaseDim rst As DAO.RecordsetDim
Temp As VariantSet db = CurrentDb If strWhere = "" Then Set rst
= db.OpenRecordset("Select [" & strFieldName & "] From [" &strTableName &
"]", dbOpenSnapshot) Else Set rst = db.OpenRecordset("Select ["
& strFieldName & "] From [" &strTableName & "] Where " & strWhere,
dbOpenSnapshot) End If If Not rst.BOF Then rst.MoveFirst
Temp = rst(0) Else Temp = Null End If rst.Close
FastLookup = TempExit_Here: On Error Resume Next rst.Close Set
rst = Nothing Set db = Nothing Exit FunctionError_Handler:
MsgBox Err.Number & ": " & Err.Description Resume Exit_HereEnd
Function--Arvin Meyer, MCP,
MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com"JK"
messageArvin,> (Other
please feel free to replay)>> Whilst on the subject, I wander if I can
increase speed:>> I have a table that maintains holidays rules/date
around the world, 800records so far and growing. There are other
"supporting" tables needed, butlet leave it out for now.>>
Background:> -------------> Each holiday has its own rule. Some of the
rules are simple (eg 25 Dec, or> 4th Thursday in Nov), others are more
involved (eg. if an holiday falls ona> weekend, Move it to Monday). Yet
others depend on another holiday (eg. 46> days after Easter Sunday).>> In
addition, each rule has its own calendar (Gregorian, Hebrew, Islamic
sofar) with or without a cross-over, e.g Easter Sunday falls on the
FirstSunday after the Jewish Passover (with exceptions)>> I have the
relevant routines to calculate the fields "ThisYearDate"
and"NextHolidayDate" (not always the same, "US presidential Election" has
Nullvalue in isYearDate" (2006) but has a value in "NextHolidayDate", 4
Nov,2008), *NO PROBLEM* thus far.>> Each time a user enter a record,
through the OnCurrent event, those twodates get updated through a
combination of a Private and a Public Functions.The same happens, through
AfterUpdate event of any field that affects therule (Only Admin can do
that), still no problem there.>> Regardless of the calendar used to
calculate the holiday date, *both*"ThisYearDate" and "NextHolidayDate"
return the date in Gregorian calendar,eg. Jewish New Year which is the
first day of the year in the Hebrewcalendar will return 23 Sep 2006 (this
year) and 13 Sept 2007 (next date)>> The Problem> --------------> Once a
year, soon after new year day, I run an update query to update allthe
dates in the table. That query runs for about *15 minutes * with
800records, not surprising under the circumstances described above.>> The
Question (finally)> ----------------------> Having written those a few
years back when I did not understand whatRecordset or DAO means, I wander
whether I should modify the routine for ayearly update to reduce the time
of a full update. I am in two minds:>> 1. If ain't broken, don't fix it>
2. If I can speed up the operation dramatically using DAO, I can
allowusers to do a general update any time.>> Thus far all the
calculations are done by whatever DLookup()'s returns.Bearing in mind
that if a holiday date is linked to another holiday, thatother holiday
has to be calculated first.>> Appreciated your comments>> Regards>
If you disambiguate, both
can be used. IMO, it would be DAO for most of>> the work. ADO is designed
to be faster with SQL-Server and for the most>> part it is. It does not
have all the functionality of DAO, but will dothe>> majority of what you
may need to do. ADO is not being developed any more>> in favor of
ADO.NET. The 2 are not alike. That alone would put a damperon>> my
deployment plans.>> -->> Arvin Meyer, MCP, MVP>>
http://www.datastrat.com>> http://www.mvps.org/access>>
http://www.accessmvp.com>>>> "Fred Wilson" <[email protected]>
wrote in message>>
Hello all,>>>>>>
I have an MS Access 2003 database that I use as a tool to manage some>>>
reports and data dumps from an oracle.>>>>>> Anyway, which is the better
records set to use, ADO or DAO and why?>>>>>> Thanks,>>> Fred>>>>>>>
 
A

aaron.kempf

well spoken



Jamie said:
Well, his approach may be 'Sling enough mud..." but, sure enough, some
of it does stick e.g. I've always found it difficult to justify in this
day and age the need to manually 'compact and repair'.

Jamie.

--
 
D

dbahooker

David;

I'm so sorry that you're a fat lazy dipshit that's stuck in the 80s.

I'm not going to let you spread misinformation.

JET IS DEAD AND SO IS DAO.

SQL Server / Access Data Projects has been out for 10 years; kids
lose the training wheels and move into the 21st century

-Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DAO vs ADO 5
ADO vs DAO 14
ACC2003/2007 + SQL Server ADO or DAO 10
DAO IS DED 18
DAO to ADO 1
Should I Learn DAO, ADO or ADO.NET ? 2
ado upgrade or dao 3
ADO -DAO problem 1

Top