PC Review


Reply
Thread Tools Rate Thread

CurrentDB.OpenRecordset error....

 
 
=?Utf-8?B?bWFyY3VzLg==?=
Guest
Posts: n/a
 
      24th May 2004
I'm trying to run Allen Brownes Error Handling Script as @
http://members.iinet.net.au/~allenbrowne/ser-23a.htm

I get a hick-up @: "Set rst = CurrentDb.OpenRecordset("tLogError")

I have used the vba exactly as on his web site... a summary is below... Am I meant to turn on a reference or something? Or any ideas why this isn't working

Thanks
Marcu

Dim rst As Recordset ' The tLogError tabl
Set rst = CurrentDb.OpenRecordset("tLogError"
With rs
.AddNe
![ErrNumber] = lngErrNumbe
![ErrDescription] = Left(strErrDescription, 255
![ErrDate] = Now(
![CallingProc] = strCallingPro
![UserName] = CurrentUser(
![ShowUser] = vShowUse
If Not IsMissing(vParameters) The
![Parameters] = Left(vParameters, 255
End I
.Updat
End Wit
rst.Clos

 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      24th May 2004
The problem is with references. See:
http://allenbrowne.com/ser-38.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"marcus." <(E-Mail Removed)> wrote in message
news:3CC7E395-E10A-4BEE-A7EE-(E-Mail Removed)...
> I'm trying to run Allen Brownes Error Handling Script as @ :
> http://members.iinet.net.au/~allenbrowne/ser-23a.html
>
> I get a hick-up @: "Set rst = CurrentDb.OpenRecordset("tLogError")"
>
> I have used the vba exactly as on his web site... a summary is below... Am

I meant to turn on a reference or something? Or any ideas why this isn't
working?
>
> Thanks,
> Marcus
>
> Dim rst As Recordset ' The tLogError table
> Set rst = CurrentDb.OpenRecordset("tLogError")
> With rst
> .AddNew
> ![ErrNumber] = lngErrNumber
> ![ErrDescription] = Left(strErrDescription, 255)
> ![ErrDate] = Now()
> ![CallingProc] = strCallingProc
> ![UserName] = CurrentUser()
> ![ShowUser] = vShowUser
> If Not IsMissing(vParameters) Then
> ![Parameters] = Left(vParameters, 255)
> End If
> .Update
> End With
> rst.Close



 
Reply With Quote
 
Nick Coe \(UK\)
Guest
Posts: n/a
 
      24th May 2004
Marcus,

Yes, could be a reference problem.

Use of CurrentDb statement implies that it needs DAO so
check references under Tools in the vba editor window. You
need to have a reference to DAO 3.6 and it is worded thus:
Microsoft DAO 3.6 Object Library

If that doesn't fix it then repost with more detail (e.g.
error messages and codes) and I'll try to reproduce the prob
on my machine.

Good luck
Nick Coe (UK)
www.alphacos.co.uk

"marcus." <(E-Mail Removed)> wrote in
message
news:3CC7E395-E10A-4BEE-A7EE-(E-Mail Removed)...
> I'm trying to run Allen Brownes Error Handling Script as @

:
> http://members.iinet.net.au/~allenbrowne/ser-23a.html
>
> I get a hick-up @: "Set rst =

CurrentDb.OpenRecordset("tLogError")"
>
> I have used the vba exactly as on his web site... a

summary is below... Am I meant to turn on a reference or
something? Or any ideas why this isn't working?
>
> Thanks,
> Marcus
>
> Dim rst As Recordset ' The tLogError table
> Set rst = CurrentDb.OpenRecordset("tLogError")
> With rst
> .AddNew
> ![ErrNumber] = lngErrNumber
> ![ErrDescription] = Left(strErrDescription,

255)
> ![ErrDate] = Now()
> ![CallingProc] = strCallingProc
> ![UserName] = CurrentUser()
> ![ShowUser] = vShowUser
> If Not IsMissing(vParameters) Then
> ![Parameters] = Left(vParameters, 255)
> End If
> .Update
> End With
> rst.Close
>



 
Reply With Quote
 
=?Utf-8?B?bWFyY3VzLg==?=
Guest
Posts: n/a
 
      24th May 2004
Thanks for your prompt replies.... yes it was the references.... I did check them and the ADO one was there. Allen's additonal article proved helpful (again!!!

It seemed like the priority order between the ADO and the DAO library... so as suggested i changed
Dim rst As Recordset

to

Dim rst As DAO.Recordset

works like a dream... thanks..

Marcus.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CurrentDB.OpenRecordset MPM1100 Microsoft Access VBA Modules 3 25th Mar 2008 11:08 PM
CurrentDB.OpenRecordset MPM1100 Microsoft Access Queries 1 25th Mar 2008 08:49 PM
Re: CurrentDb.OpenRecordset Bruce M. Thompson Microsoft Access VBA Modules 0 20th Sep 2003 12:30 AM
Re: CurrentDb.OpenRecordset Tim Ferguson Microsoft Access VBA Modules 0 2nd Sep 2003 08:14 PM
Re: CurrentDb.OpenRecordset Cheryl Fischer Microsoft Access VBA Modules 0 2nd Sep 2003 05:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:13 AM.