Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2003, 06:08 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unknown function name

Hi!

I have some code like this:

dim set1 as recordset, set2 as recordset
Set set1 = MyBase.OpenRecordset("qQuery1", dbOpenSnapshot)
set1.Filter = "Type=3"
Set set2 = set1.OpenRecordset(dbOpenSnapshot)
...Update some variables in a table that qQuery1 uses, that's why I use snapshot on set1 and set2, so they are frozen at the time of query...
set2.MoveFirst
set2.MoveNext

And on the last line here I get an error message: "Unknown function name" on MoveNext. But I can't see why! I think this should be legal! Any tips greatly appreciated!

Yours sincerely

Knut Hunstad
 
Old October 20th, 2003, 08:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Make sure all your reference libraries are open, e.g. DAO 3.6.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old October 20th, 2003, 09:32 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check to make sure your recordset count is <> 0

Sal
 
Old October 23rd, 2003, 04:28 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your suggestions! Unfortunately, I don't think they apply to me...

As far as I can see, I have all necessary libraries (including DAO 3.6) referenced (or what do you mean by "open"?). BTW, this is a program that has worked for a long time, except I changed the query a bit, so I can't quite believe it's a library problem.

And although I let it out in my example code, I always check for EOF before applying MoveNext, so I don't think checking the RecordCount would help either (the first record achieved by MoveFirst is OK, it's the MoveNext that gives the error).

 
Old October 23rd, 2003, 05:23 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello again!

This problem seems to have been an error that is corrected in SP8 of the Jet Engine (which came yesterday, I think!). At least, after running Windows Update and installing this update, everything is OK! I was already getting more or less determined that this must have been an error in Access/Jet or something outside of my software, and it seems I was right (this time).

Thanks to you both for trying!

Yours sincerely,

Knut






Similar Threads
Thread Thread Starter Forum Replies Last Post
Unknown Server Tag sharon5469 ASP.NET 1.0 and 1.1 Basics 3 June 18th, 2008 03:03 PM
Unknown runtime error abhishekkashyap27 C# 2005 6 April 8th, 2008 04:43 AM
Unknown Error!!!! arun_sunmic Pro Java 2 July 25th, 2006 11:24 PM
Unknown Gaz LG Danha Pro VB Databases 0 October 27th, 2004 02:21 AM
Unknown reason arnab2410 Pro VB Databases 0 February 9th, 2004 05:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.