473,699 Members | 3,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DAO or ADO in an MDE data base?

Hi,
I am using Access2000 and have developed a data base which successfully uses
DAO code in some of the forms to update tables.
Recently I converted the data base to a split MDE data base and now get
errors in the DAO methods.
IE:
Dim Rst As DAO.Recordset
Set Rst = CurrentDb.OpenR ecordset("Table Name")
Rst.Index = "IndexName"

The code halts at the last line above with the error message "Operation not
supported by this type of object"

Should the DAO code work on an MDE data base or should I be using ADO code.

Paul Copeland
Nov 12 '05 #1
4 5269
On Tue, 16 Sep 2003 22:05:46 GMT in comp.databases. ms-access, "Paul
Copeland" <pa***@ngbrown. com.au> wrote:
Hi,
I am using Access2000 and have developed a data base which successfully uses
DAO code in some of the forms to update tables.
Recently I converted the data base to a split MDE data base and now get
errors in the DAO methods.
IE:
Dim Rst As DAO.Recordset
Set Rst = CurrentDb.OpenR ecordset("Table Name")
Rst.Index = "IndexName"

The code halts at the last line above with the error message "Operation not
supported by this type of object"

Should the DAO code work on an MDE data base or should I be using ADO code.


ADO would not support that even on the local tables. The DAO method
you're using only works for tables in the database that you're working
in, not attached tables, you need to open the backend database first,
e.g.

Dim db As database, rs as recordset

set db = dbengine(0).ope ndatabase("c:\f oo\bar\mydata.m db")
set rs=db.openrecor dset("TableName ")
rs.index="Index Name"
....
rs.close
set rs=nothing
db.close
set db=nothing

Remember this is a database object you will have to close since you
opened it.

--
A)bort, R)etry, I)nfluence with large hammer.

(replace sithlord with trevor for email)
Nov 12 '05 #2
Thanks Trevor,
Are you saying that the DAO code as I have used is restricted to local
database applications i.e. .mdb files as the code in my posting does work on
my .mdb file without error.
If I wish to split my database so I can have a number of users accessing
the one database file on a server do I need to modify my code as per your
example. If this is the case how do I get around the fixed reference
opendatabase("c :\foo\bar\mydat a.mdb") in your "set db" statement as this
means the location of the database files are hard coded in VB? Not very
flexible.
Paul Copeland

"Trevor Best" <bouncer@localh ost> wrote in message
news:s2******** *************** *********@4ax.c om...
On Tue, 16 Sep 2003 22:05:46 GMT in comp.databases. ms-access, "Paul
Copeland" <pa***@ngbrown. com.au> wrote:
Hi,
I am using Access2000 and have developed a data base which successfully usesDAO code in some of the forms to update tables.
Recently I converted the data base to a split MDE data base and now get
errors in the DAO methods.
IE:
Dim Rst As DAO.Recordset
Set Rst = CurrentDb.OpenR ecordset("Table Name")
Rst.Index = "IndexName"

The code halts at the last line above with the error message "Operation notsupported by this type of object"

Should the DAO code work on an MDE data base or should I be using ADO
code.
ADO would not support that even on the local tables. The DAO method
you're using only works for tables in the database that you're working
in, not attached tables, you need to open the backend database first,
e.g.

Dim db As database, rs as recordset

set db = dbengine(0).ope ndatabase("c:\f oo\bar\mydata.m db")
set rs=db.openrecor dset("TableName ")
rs.index="Index Name"
...
rs.close
set rs=nothing
db.close
set db=nothing

Remember this is a database object you will have to close since you
opened it.

--
A)bort, R)etry, I)nfluence with large hammer.

(replace sithlord with trevor for email)

Nov 12 '05 #3
No, the problem is that use of the seek command,a nd the index command is a
very old legacy command. It is a throwback to the old dbase/dos days.

You can use dao freely, but use of seek on linked tables requires some
special coding. There is a work around for this problem here:

http://www.mvps.org/access/tables/tbl0006.htm
Note that seek does not work on sql server, or in fact for odbc connections
to any other database. It should be avoided. However, it has VERY high
performance, so don't be too quick to not use it!
--
Albert D. Kallal (MVP)
Edmonton, Alberta Canada
ka****@msn.com
http://www.attcanada.net/~kallal.msn
Nov 12 '05 #4
On Wed, 17 Sep 2003 01:56:35 GMT in comp.databases. ms-access, "Paul
Copeland" <pa***@ngbrown. com.au> wrote:
Thanks Trevor,
Are you saying that the DAO code as I have used is restricted to local
database applications i.e. .mdb files as the code in my posting does work on
my .mdb file without error.
If I wish to split my database so I can have a number of users accessing
the one database file on a server do I need to modify my code as per your
example. If this is the case how do I get around the fixed reference
opendatabase(" c:\foo\bar\myda ta.mdb") in your "set db" statement as this
means the location of the database files are hard coded in VB? Not very
flexible.


It need not be a fixed reference but a variable, you can even get the
path from the .Connect property of the table, useful if you attach
tables from different back-ends simultaneously. (you'll need to strip
off the ";DATABASE= " bit from the front.

--
A)bort, R)etry, I)nfluence with large hammer.

(replace sithlord with trevor for email)
Nov 12 '05 #5

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

Similar topics

1
1872
by: Alexander Kervero | last post by:
Hi ,today i was reading diveinto python book,in chapter 5 it has a very generic module to get file information,html,mp3s ,etc. The code of the example is here : http://diveintopython.org/object_oriented_framework/index.html One thing that i have some doubs is this part : class FileInfo(UserDict): "store file metadata"
3
3770
by: Daniel Graifer | last post by:
Why doesn't c++ support virtual data? It supports class data of type pointer to function (that's what virtual functions really are). In terms of implementation, why can't I have other types of data in my vtable? RTTI could be implemented this way instead of as a special case for the compiler. It would also be useful for class specific memory management implementations. -- Daniel A. Graifer
7
1876
by: Zaharije Pasalic | last post by:
I tried to implement multi-data list with a reference instead of pointer to data, but code compiled with gcc perform "segmentation fault". Generated code from other compilers: Borland C++ 5.0 and Micros. C++ 6.0 is OK. What is wrong? #include <iostream> using namespace::std; class base {
28
3413
by: Act | last post by:
Why is it suggested to not define data members as "protected"? Thanks for help!
2
1507
by: Vicente Nicolau | last post by:
Hello I'm making a PDA project that uses a data base. That data base is saved in a xml file. When the application starts up, I load the xml file in memory. The application makes changes in the data base (which is in the memory of the PDA) and finally, when the program closes, it saves all data (which are in the data base) in the xml file. My question is: is there any way to save only the modifications instead of to save again all data...
5
1508
by: Lloyd Dupont | last post by:
I'm attempting to write a fairly complex data structure. One part of the complexity is that all 8 data operations it supports delegate some code to virtual method. This is by design because I want the user to subclass the data structure and be able to prevent changes to happen. and / or I want to notify observers. The unfortunate side effect is: it seems there are no simple way to have all user code run at the begining or at the end...
7
1661
by: atomik.fungus | last post by:
Hi, im having problems compiling some code, and i dont understand why. I've made a Matrix class for any kind of data and now im implementing an inherited class with all the mathematical stuff (MMatrix) (determinants and so on). The data and the number of rows and columns are declared in the base clase as protected. When i ask the functions of the inherited class to use them, the compiler(g++) tells me that they haven't been declared in...
3
2633
by: nandhanvijay | last post by:
hi every am trying to connect data base in vb.net but am unable to connect. As per the book am following that says to connect to data base go to tools menu connect to data base option. u will get data link property . But am not getting that . Am getting add connection from which i can able to select the data base like oracle or sql but not able to move further. When i click test button. your test connection is fail. am not able to get data...
5
3586
by: ElTipo | last post by:
Hello People, I made a data base with secure wizard to provide to users a PID and Passwords. I need to extract data from Crystal Reports 7 in this data base but Crystal Reports send me a message like I cant extract data because I don't have rights to this data base. I am the "Admin" I don't Know what happens in this case. I try to change the "Set Location" in Crystal Rpts but no results. Crystal don't show me any window to put the...
6
2179
by: Immortal Nephi | last post by:
First class is the base class. It has two data: m_Base1 and m_Base2. Second class and third class are derived classes and they are derived from first class. m_Base1 and m_Base2 are inherited into two derived classes. Second class has its own m_Base1 and m_Base2 and third class does the same. I am curious. How can second class and third class share the same m_Base1 and m_Base2? You define second class first and enter data into...
0
8709
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
9202
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
9058
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
6555
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
4395
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
4649
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3081
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 we have to send another system
2
2371
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2018
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.