473,320 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Recordset retrieval Error

The code creating the recordset that is commented out below works on all my user's machines except two. What is especially irritating is that this code did work on one of their machine for several months. In trying to fix a different problem he was having with the app MS office XP was reloaded twice just to make sure everything was loaded. Various internals were also looked at. We know its the machine problem because the user can login onto any other machine and the app works fine.

When reading through posted issues the comment was made about specifying DAO so I tried that. No luck. My user community uses both MS 2000 and XP so apps are built in 2000, then tested to make sure they work in XP. I've never seen this problem before.

I use recordset retrieval many, many times throughout many apps so resolving this issue carries quite a bit of weight. Any ideas how to fix this? linda

Dim db As DAO.Database
Dim rstckout As DAO.Recordset

Set db = CurrentDb()
Set rstckout = db.OpenRecordset("tblEmpWeekEnding")

Set db = CurrentDb()
Set rstckout = db.OpenRecordset("tblEmpWeekEnding")

' strSQLout = "SELECT * FROM [tblEmpWeekEnding];"
' Set rstckout = CurrentDb.OpenRecordset(strSQLout)
With rstckout
.AddNew
.Fields("Person_ID") = Me.Person_IDtemp
.Update
End With
rstckout.Close

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
4 1266
linda williams via AccessMonster.com wrote:
The code creating the recordset that is commented out below works on
all my user's machines except two. What is especially irritating is
that this code did work on one of their machine for several months.
In trying to fix a different problem he was having with the app MS
office XP was reloaded twice just to make sure everything was loaded.
Various internals were also looked at. We know its the machine
problem because the user can login onto any other machine and the app
works fine.

When reading through posted issues the comment was made about
specifying DAO so I tried that. No luck. My user community uses both
MS 2000 and XP so apps are built in 2000, then tested to make sure
they work in XP. I've never seen this problem before.

I use recordset retrieval many, many times throughout many apps so
resolving this issue carries quite a bit of weight. Any ideas how to
fix this? linda

Dim db As DAO.Database Dim rstckout As DAO.Recordset

Set db = CurrentDb() Set rstckout =
db.OpenRecordset("tblEmpWeekEnding")

Set db = CurrentDb() Set rstckout =
db.OpenRecordset("tblEmpWeekEnding")

' strSQLout = "SELECT * FROM [tblEmpWeekEnding];" ' Set rstckout =
CurrentDb.OpenRecordset(strSQLout) With rstckout .AddNew
.Fields("Person_ID") = Me.Person_IDtemp .Update End With
rstckout.Close


What is the problem? Do you get an error? Does it not add a record?
Can it open the recordset? What happens if you copy the SQL statement
and paste it into a new query? Does it work?
Nov 13 '05 #2
SQL works fine when pasted into a query. The error that I receive is that the recordset is empty consequently any code after that is ignored (no record is added).

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3
Some more. Tried creating a new database and importing the objects. Didn't work.

Noticed in the last several days that when repairing and compacting any Access DB the size would diminish dramatically 1,400 KB to 800 KB - not what I would expect. Then at other times it would repair/compact and be over 1,000KB. I have been working with MS ACCESS over 5 years and I've never seen the repair/compact act so erradically. I normally have a pretty good idea of what the KB reduction should be so I know what is out of the ordinary. Could this be a sign that MS Access is falling apart on my machine and should be reloaded????

I'll be out the next couple days. Hope there are suggestions as to what to try to make this thing work again. linda

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #4
linda williams via AccessMonster.com wrote:
Some more. Tried creating a new database and importing the objects.
Didn't work.

Noticed in the last several days that when repairing and compacting
any Access DB the size would diminish dramatically 1,400 KB to 800 KB
- not what I would expect. Then at other times it would
repair/compact and be over 1,000KB. I have been working with MS
ACCESS over 5 years and I've never seen the repair/compact act so
erradically. I normally have a pretty good idea of what the KB
reduction should be so I know what is out of the ordinary. Could
this be a sign that MS Access is falling apart on my machine and
should be reloaded????

I'll be out the next couple days. Hope there are suggestions as to
what to try to make this thing work again. linda


I pasted your code into this e-mail. Hmmmm....everything looks OK. If
this routine is called in a form, I might turn off Error checking.
Ctrl+f and search for On Error and change to 'OnError. Maybe there is
an error that is created that is not being displayed?

Maybe change
Set rstckout = db.OpenRecordset("tblEmpWeekEnding")
to
Set rstckout = db.OpenRecordset("tblEmpWeekEnding", dbopensnapshot)
I doubt that will change anything, but who knows?

I might want to know what the record count is. Ex:
Set rstckout = db.OpenRecordset("tblEmpWeekEnding")
msgbox rstchkout.recordcount
If 0, then zero recs. If 1, you should be able to MoveLast.

Is it possible that tblEmpWeekEnding is a linked table? Go into linked
table manager and determine it is pointing to a production mdb and not a
test mdb.

Since you are going to be away for a couple of days, I'd repost again.
I doubt many people go back to old threads. I may go back 2 days in a
thread, but once it gets old, responses tend to thin.

Set db = CurrentDb()
Set rstckout = db.OpenRecordset("tblEmpWeekEnding")

' strSQLout = "SELECT * FROM [tblEmpWeekEnding];"
' Set rstckout = CurrentDb.OpenRecordset(strSQLout)
With rstckout
.AddNew
.Fields("Person_ID") = Me.Person_IDtemp
.Update
End With
rstckout.Close
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Thomas Scheiderich | last post by:
Why would you use the Recordset object over the Execute method of getting data from your Sql database. For example, I have the following: Execute Method...
8
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be...
1
by: andrewdreib | last post by:
I am still very new to ASP and am trying to create an ASP page that gets records from a database. Right not I can successfully get one field of information at a time and randomize it, but I need...
6
by: Alan Silver | last post by:
Hello, I have an ASP that takes a connection string and SQL statement in the querystring and is supposed to return the XML representation of the recordset to the Response stream (don't worry,...
22
by: Gerry Abbott | last post by:
Hi all, I having some confusing effects with recordsets in a recent project. I created several recordsets, each set with the same number of records, and related with an index value. I create...
12
by: (Pete Cresswell) | last post by:
Say I've got a RecordSet: ----------------------------------------------------------- Set myRS = CurrentDB.OpenRecordset(SomeSQL, dbOpenDynaset)...
6
by: AlanMF | last post by:
A problem recently cropped up that I have not seen before and I am wondering anyone has seen this one? The 2 SQl Select statements on my ASP page differ by the addition of one column...
0
by: JosAH | last post by:
Greetings, Introduction At the end of the last Compiler article part I stated that I wanted to write about text processing. I had no idea what exactly to talk about; until my wife commanded...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.