Hi again,
You are correct, the advice is not affected, dbOpenForwardOnly is still the
one you need in this situation.
The VBA function "Erl" returns the line number where the most recent error
occurred. You will need to number all your lines, but that shouldn't be too
great a hardship if the procedure is not large.
Having any users sharing a front-end file is a bad idea, but in your case
it's doubly bad because of the way you are using "qdfreusable". There is
every possibility that your users are colliding over the use of this query
object.
<mirandacascade@yahoo.comwrote in message
news:b51bf39e-482c-4471-a668-af6f13c48760@2g2000hsn.googlegroups.com...
On Sep 19, 11:21 pm, "bcap" <b...@nospam.nowherewrote:
Quote:
Since you are using SQL Server linked tables, you have a choice of three:
>
dbOpenForwardOnly: recordset can't be updated, and you can't navigate in
it
except to iterate forwards from beginning to end.
dbOpenSnapshot: recordset can't be updated, but you can navigate in it.
dbOpenDynaset: recordset is updatable and fully navigable (this is the
default).
>
In your case, since the recordset apparently only returns one record and
you
don't need to update it, dbOpenForwardOnly should do the job.
I didn't mention this in the original post (and I don't think it
changes the information/advice above regarding which value to choose
in the type argument of the OpenRecordset) but in case it is, in fact,
relevant, I'll mention it here because I noticed a reference to
'...linked tables':
The Access app does NOT have any linked tables. The Access app calls
a stored proc, and that sproc performs a SQL Server 2000 SELECT
statement from a SQL SERVER 2000 table...that SELECT statement returns
the result set back to the Access app. But if one were to look at the
Tables tab of the Database window of the MS Access app, one would not
see any linked tables.
Quote:
However, I am far from convinced that this is the cause of your problem.
The error you are getting is an obscure Access error and my guess is that
it
has nothing to do with locking in the SQL Server database (particularly
since you appear to be doing nothing which updates the database)
....correct...no updates going on
Quote:
and is something to do with locking in your Access front-end file, perhaps
when you
try to update the SQL property of the query. Presumably you have some kind
of error handling which tells you that this is the procedure where the
error
occurs:
....correct...the function has ON ERROR logic that informs me that the
error happened somewhere within the function
Quote:
if so, it would be a good idea to enhance it to report the line number
where the error occurs.
....yes, that is a good idea. I know how to do that in a "brute force"
manner, e.g. by:
a) updating a variable after each line successfully executes
b) having the exception handling code display the contents of
the variable
but I was wondering whether MS Access provides a more elegant way for
me to do that...is there some built-in value that identifies the
specific line on which the error occurred?
Quote:
Does each user have their own copy of your Access front-end, or are they
sharing the same file?
It's more like the former than the latter. The application is
distributed to multiple servers across the company network, so it
resembles the "each user has their own copy", but there may be more
than one user of the application from the same server...there are not,
however, a large number of users sharing the same app on any given
server. The most active server has about a dozen users sharing that
application, but it's never the case that there are more than 3 or 4
users on at any given time, and it's usually the case that there is
usually zero or one user on at any given time.
Quote:
If the latter, this is a bad idea and you should
distribute a "local" copy to each user. Does the front-end get regularly
compacted/repaired?
The front-end gets compacted/repaired about once every other month.
Thank you.