Hi Tom,
Thanks for your feedback. For references to ADO and DAO, I'd
recommend visiting the MSDN website.
http://msdn.microsoft.com
Search the key words ADO and DAO, you may find a couple of technical
articles may be useful. Here is an article provides a guide to
revising code that uses Microsoft Data Access Objects (DAO) into code
that uses Microsoft ActiveX Data Objects (ADO), as well as a guide to
writing new code using ADO with the Microsoft Jet Provider. Includes
a discussion on the general differences between DAO and ADO and looks
at some of the advantages to using ADO over DAO.
Migrating from DAO to ADO
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndao
/html/daotoadoupdate.asp
You may alos want to refer to the following links for more
information.
Data Access Objects (DAO)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccor
e/html/_core_database_topics_.28.dao.29.asp
ActiveX Data Objects 2.8 Start Page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado27
0/htm/pg_introduction.asp
Sincerely,
William Wang
Microsoft Partner Online Support
Get Secure! -
www.microsoft.com/security
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
| From: "Tom Hagen Jr" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
<#
[email protected]>
<#
[email protected]>
<#
[email protected]>
<#
[email protected]>
<
[email protected]>
<
[email protected]>
<e#
[email protected]>
<#
[email protected]>
| Subject: Re: Problems with Recordset in Access 2000
| Date: Thu, 18 Sep 2003 12:30:54 -0500
| Lines: 147
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.access.modulesdaovba.ado
| NNTP-Posting-Host: mplsdslgw26poolb28.mpls.uswest.net 63.231.161.28
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.access.modulesdaovba.ado:13913
| X-Tomcat-NG: microsoft.public.access.modulesdaovba.ado
|
| William
| Thanks a TON. That did it.
|
| Can anyone tell me a great book to get that explains the coding?
Like I've
| been saying my help files are not work even after deleting and
reinstalling
| Office 2000. I went out and bought Running Access 2000 and Access
2000
| Fundamentals but they don't go into great amounts of detail that
I'm use to
| with Access 2, 95 and 97. Like the difference between DAO and ADO
coding.
| Which turns out I need to learn about.
|
| Thanks again everyone for your help.
|
| Tom Hagen Jr
message
| | > Hi Tom,
| >
| > The following code seems to be fine on my side. Please try it to
see
| > if it works:
| >
| > Public Function Find_Fed_Tax(MS As String, PP As String, TI As
| > Currency) As Currency
| > 'MS is Marriage Status, PP is Payroll Period, TI is Taxable Income
| >
| > 'Create a connection to the current Database
| > Dim db As ADODB.Connection
| > Set db = CurrentProject.Connection
| >
| > 'Create a temp storage location for the info needed to do the
math
| > Dim rstFFT As New ADODB.Recordset
| > Dim sqlCode As String
| >
| > 'Using the old method of recordset to try and create the temp
| > numbers needed this Is Not working
| > sqlCode = "Select * FROM [Federal Tax] WHERE [Marriage
| > Status]= " & "'" & MS & "' And [Payroll Period]= '" & PP & "'
| >
| > And [Over]<= " & TI & " And [Not Over]> " & TI
| >
| > rstFFT.Open sqlCode, db, adOpenForwardOnly, adLockOptimistic
| >
| > 'Do the math for the amount to be taxed as the rstFFT is not
| > working this will also fail
| > Find_Fed_Tax = rstFFT![Income tax to withhold] + (TI -
| > rstFFT![Over]) * rstFFT![% to withhold]
| > rstFFT.Close
| >
| > End Function
| >
| > Sincerely,
| >
| > William Wang
| > Microsoft Partner Online Support
| >
| > Get Secure! -
www.microsoft.com/security
| > =====================================================
| > When responding to posts, please "Reply to Group" via
| > your newsreader so that others may learn and benefit
| > from your issue.
| > =====================================================
| >
| > This posting is provided "AS IS" with no warranties, and confers
no
| > rights.
| > --------------------
| > | From: "Tom Hagen Jr" <
[email protected]>
| > | References: <
[email protected]>
| > <
[email protected]>
| > <#
[email protected]>
| > <#
[email protected]>
| > <#
[email protected]>
| > <#
[email protected]>
| > <
[email protected]>
| > <
[email protected]>
| > | Subject: Re: Problems with Recordset in Access 2000
| > | Date: Wed, 17 Sep 2003 22:14:53 -0500
| > | Lines: 45
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <e#
[email protected]>
| > | Newsgroups: microsoft.public.access.modulesdaovba.ado
| > | NNTP-Posting-Host: mplsdslgw26poolb28.mpls.uswest.net
63.231.161.28
| > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| > microsoft.public.access.modulesdaovba.ado:13908
| > | X-Tomcat-NG: microsoft.public.access.modulesdaovba.ado
| > |
| > | Dan,
| > | Thanks. I changed the code from:
| > | Set rstFFT = db.OpenRecordset(sqlCode)
| > | to
| > | rstFFT.Open sqlCode, db, adOpenForwardOnly,
adLockOptimistic
| > |
| > | Now I get an error saying that = is expected. I tried a few
thing
| > but
| > | nothing worked. I feel we are close....
| > |
| > | As to why ADO vs DAO. I'm new to the changes to 2000. I was
| > trying to get
| > | the code up and running ASAP. All I could find was references
to
| > ADO. The
| > | Help files are not working when I try and pull up help on DAO
| > nothing would
| > | come up. Still have no answer as to how to fix the help files
so I
| > can look
| > | at all the info. If someone can tell me how to get the help
files
| > to work I
| > | should be able to figure this stuff out.
| > |
| > | Thanks again for your help.
| > |
| > | Tom
| > |
| > | | > | > Hi,
| > | > Two things, do a Debug.Print sqlCode to see what your string
| > evaluates to.
| > | > Copy and paste that into the query designer and see if it
works.
| > | >
| > | > Second, I just noticed that you have:
| > | > Set rstFFT = db.OpenRecordset(sqlCode)
| > | >
| > | > To the best of my knowledge there is no OpenRecordset method
of
| > the
| > | > connection object (I checked this out from VB, not Access,
using
| > ADO 2.6)
| > | >
| > | > I use this to open an rs:
| > | >
| > | > rstFFT.Open sqlCode, db, adOpenForwardOnly, adLockOptimistic
| > | >
| > | > Once again, you don't have to use ADO, why not just stick with
| > DAO and
| > | eliminate
| > | > all these problems?
| > | >
| > | > --
| > | > HTH
| > | > Dan Artuso, Access MVP
| > |
| > |
| > |
| >
|
|
|