
'DBEngine.Idle dbRefreshCache' ERROR
The 'variable' dbRefreshCache is undefined; it's a constant exported by the
DAO library - set a reference to:
\Program Files\Common Files\Microsoft Shared\DAO350.dll
As you have included several libraries, exporting database objects with very
similar names, I'd suggest that you use fully-qualified references all
through your code, eg:
Dim rstStocks as DAO.Recordset
Dim qdfCGtax as DAO.QueryDef
Dim dbPortfolio as DAO.Database
Dim dblCharge as Double
Set dbPortfolio = DAO.DBEngine.DBEngine.OpenDatabase(strMdbPath, False)
set qdfCGtax = dbPortfolio.QueryDefs("qryCapitalGains")
qdfCGtax.Parameters("CutoffDate") = Cvdate("04-Apr-" & Year(Now()))
set rstStocks = qdfNewIssues.Openrecordset
rstStocks.MoveFirst 'fails if rst is an ADO object
DAO.DBEngine.BeginTrans
Do until rstStocks.EOF
dblCharge = funcCGT(rstStocks!HoldingID, rstStocks!Type2)
rstStocks.Edit
rstStocks!Charges = rstStocks!Charges + dblCharge
rstStocks!CGTflag = True
rstStocks.Update
rstStocks.MoveNext
Loop
DAO.DBEngine.CommitTrans
It's a chore (call me paranoid if you like) but code without explicit
references will fail on someone's PC (a lot of machines assume, for example,
that Recordsets are ADO)... And there is no guarantee - none at all - that
next years' up-to-the-minute Office and Windows PC will have data access
class libraries that do what you were expecting *any* DAO (or ADO!) object to
do in this years' applications.
Regards -
Nigel Heffernan
Quote:
>Access 2000
>Statement 'DBEngine.Idle ' is not giving any errors.
>Why am I getting error 'Variable not defined' in the statement:
>'DBEngine.Idle dbRefreshCache'
>References I have are:
>- Visual Basic for Applications
>- Microsoft Access 9.0 Object Library
>- OLE Automation
>- Microsoft ActiveX Data Objects 2.5 Library
>- Microsoft ActiveX Data Objects Recordset 2.5 Library
>- Microsoft ADO Ext. 2.5 for DDL and Security
>Thanks,
>Waldemar
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts