473,725 Members | 2,271 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recordset.Index gives error in XP

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.OpenRecordse t(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
'============== =============== =============

Nov 13 '05 #1
3 4302
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 somethingorothe r. 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
Nov 13 '05 #2
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.co m> wrote in message
news:Ni******** **********@twis ter.nyroc.rr.co m...
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 somethingorothe r. 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.

Nov 13 '05 #3
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.co m> wrote in message
news:Ni******** **********@twis ter.nyroc.rr.co m...
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 somethingorothe r. 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.


Nov 13 '05 #4

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

Similar topics

12
5947
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 from the GLOBAL.ASA page. I'm using a DSN to connect to the database. The error I'm getting is: Microsoft OLE DB Provider for ODBC Drivers error '80004005' Data source name not found and no default driver specified /index.asp, line 14
6
1726
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, this is a local page, not one on the Internet). I had it working fine with row-returning SQL, such as SELECT, but was trying to get it to work with non-row-returnign ones as well (such as UPDATE and DELETE). Not only can't I get this bit to work, I...
2
5193
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 for a MS SQL Server DTS package. That I know how to do. I just don't know how to open the Connection and/or Recordset so I can change the SQL WHERE clause in the loop & then update the resulting recordset.
12
17656
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 that only returns the first record set. I thought I could use ADO but that does not seem to work. I get an Error
5
1849
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 recordset code someone else used to do a similar job a few years ago. As I'm fairly new to vb. There are 49 lines of text in each letter, there can be any number of letters in the file and when I run the code I get 'Runtime error 62 input past end of...
0
9005
ADezii
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 Recordset? Does the Recordset support Bookmarks? Can we use the Find and/or Seek Methods with this Recordset? Does the Recordset support the use of Indexes? Will the Absoluteposition property be able to be used on this Recordset? etc....
1
1196
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: Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. This is my code: <% call OpenDB() set rs = Server.CreateObject("ADODB.recordset") sql="SELECT * FROM project ORDER BY id"...
2
5515
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 results page. - Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code): SELECT * FROM db_name WHERE (db_field1 LIKE ‘%text1%’ OR db_field2 LIKE ‘%text2%’)
3
3830
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 concatenate the contents of all the records for one field-, and populate the resulting into textbox of a form Private Sub Form_Load() Dim db As Database Dim rstUpdates As Recordset Set db = CurrentDb Set rstUpdates = db.OpenRecordset("Daily...
0
8889
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.