I've developed a database in Access 2000 on Windows 2000. I have been
asked to put the database on a machine running Windows XP. I copied
the database onto the XP machine with some data already in it.
Everything seemed to be working correctly, until I tried to import new
data.
New data is imported into the database from a floppy disk. To prevent
duplicate entries, I have a boolean function called Exists which uses
the Seek method of Recordset to search for a value already existing in
a table. If the value is in the table, Exists returns True, and False
otherwise.
This function works correctly on my Windows 2000 machine, but on the XP
machine I get the following error message:
Error 3251: Operation is not supported for this type of object
Below is my code for the Exists function with a comment showing where
the error occurs. My references include Microsoft DAO 3.6 Object
Library.
I would greatly appreciate if anyone could tell me why this error is
occurring on the XP machine and how I can correct it. I would even
take suggestions for an alternate way of doing the same thing.
'==========================================
Public Function Exists(strRS As String, _
strIndex As String, _
strTarget As String) As Boolean
' checks if an indexed value exists in a given recordset
' returns true is value exists, false otherwise
' strRS = recordset to search
' strIndex = field to search on
' strTarget = value being searched for
Dim db As dao.Database
Dim RS As dao.Recordset
Set db = CurrentDb
Set RS = db.OpenRecordset(strRS)
RS.Index = strIndex ' <== ERROR OCCURS HERE
RS.Seek "=", strTarget
If RS.NoMatch = True Then
Exists = False
Else
Exists = True
End If
RS.Close
End Function
'========================================== 3 4279
OK, so I thought the problem was a result of the app being developed on
Windows 2000 and then being moved to XP, and there was some version conflict
with somethingorother. But I tried this on my XP laptop at home, and it
works fine.
I'm still curious if anyone has any idea about what the problem could be,
but I'm going to use DCount instead of the Recordset methods. I just need
to wait until I'm back in the office to see if DCount gives me any trouble
on the other machine.
Thanks in advance.
Randy
DCount() should be fine.
The Seek method (DAO) works only for recordsets of type dbOpenTable.
That type applies only to local tables, not attached tables which open as
dbOpenDynaset by default.
--
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.
"Randy A. Bohannon" <bo******@rr.com> wrote in message
news:Ni******************@twister.nyroc.rr.com... OK, so I thought the problem was a result of the app being developed on Windows 2000 and then being moved to XP, and there was some version conflict with somethingorother. But I tried this on my XP laptop at home, and it works fine.
I'm still curious if anyone has any idea about what the problem could be, but I'm going to use DCount instead of the Recordset methods. I just need to wait until I'm back in the office to see if DCount gives me any trouble on the other machine.
Thank you for the explanation. That makes perfect sense - I split the
application on the XP machine at work, but not on my laptop.
Allen Browne wrote: DCount() should be fine.
The Seek method (DAO) works only for recordsets of type dbOpenTable. That type applies only to local tables, not attached tables which
open as dbOpenDynaset by default.
-- 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.
"Randy A. Bohannon" <bo******@rr.com> wrote in message news:Ni******************@twister.nyroc.rr.com... OK, so I thought the problem was a result of the app being
developed on Windows 2000 and then being moved to XP, and there was some version
conflict with somethingorother. But I tried this on my XP laptop at home,
and it works fine.
I'm still curious if anyone has any idea about what the problem
could be, but I'm going to use DCount instead of the Recordset methods. I
just need to wait until I'm back in the office to see if DCount gives me any
trouble on the other machine. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Grahammer |
last post by:
For some reason I am getting an error when trying to open a recordset on an
Access database on my Win2K3 machine from my INDEX.ASP page, but the same
code accesses the database fine when coming...
|
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,...
|
by: MGFoster |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I want the recordset (rs) in the following function to be updateable.
How do I do it?
Even though the code is VBA I will be translating to VBS...
|
by: Scott |
last post by:
Front-end Access 2000
I have a stored procedure that has 2 parameters BusinessUnitID and
Year.
It returns multiple record sets (5 to be exact).
I thought I could use a Pass through query but...
|
by: Wendy |
last post by:
Hi
I'm trying to import the contents of a text file which is basically letters
in to a table to add more data to them. The original file comes from the
mainframe.
I'm tring to copy the...
| |
by: ADezii |
last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be:
Can I add New Records to the...
|
by: lxxslay3rxxl |
last post by:
Let's say I haf 3 project that I wan to list, each project should have 1 value assign to it, but if i remove 1 of the value for 1 of the project, and i tried to list all 3 projects, I get this error:...
|
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...
|
by: Kassimu |
last post by:
Hi there,
I have a table with thousands of record entries, usually the user searches this table through SearchForm resulting into some recordset. What I need to do on this recordset is to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |