CurrentDB.OpenRecordset error....

G

Guest

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
 
A

Allen Browne

The problem is with references. See:
http://allenbrowne.com/ser-38.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

marcus. said:
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
 
N

Nick Coe \(UK\)

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

message
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
 
G

Guest

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.
 

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

Top