473,385 Members | 1,912 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,385 software developers and data experts.

HELP! Data control error (I've looked everywhere)

I have a data control that I write a sql statement on the fly and
populate the recordset like so.

Set Rst = Db.OpenRecordset("SELECT DISTINCT * FROM Source_UnitMaster
.... join and where clause")
set dat_Equip.Recordset = Rst (this is a DAO recordset)

This gives me a "operation is not supported by this object" at the
second line.

Oddly if I remove the DISTINCT it does not error out. Even more
weird, if I remove a few fields from the Source_UnitMaster it works
with the DISTINCT.

As far as I can tell it seems to be a jet issue because the code works
fine in Access 2002. I read somewhere that VB 5.0 uses a diferrent
version of Jet than Access 2002.

Is there a size limit to the data control, if so how do I get around
this?

I realize that the data control is problably not the best way to do
it, but this is an existing app that i really don't want to redo if
possible.

Some stats.
VB version 5.0 sp3
Access 2002
DAO 3.6 referenced

Thanks for the help.
Jul 17 '05 #1
5 2349
I could be mistaken, but isnt DISTINCT a shape operator....

"bhieb" <bh***@alanritchey.com> wrote in message
news:29**************************@posting.google.c om...
I have a data control that I write a sql statement on the fly and
populate the recordset like so.

Set Rst = Db.OpenRecordset("SELECT DISTINCT * FROM Source_UnitMaster
... join and where clause")
set dat_Equip.Recordset = Rst (this is a DAO recordset)

This gives me a "operation is not supported by this object" at the
second line.

Oddly if I remove the DISTINCT it does not error out. Even more
weird, if I remove a few fields from the Source_UnitMaster it works
with the DISTINCT.

As far as I can tell it seems to be a jet issue because the code works
fine in Access 2002. I read somewhere that VB 5.0 uses a diferrent
version of Jet than Access 2002.

Is there a size limit to the data control, if so how do I get around
this?

I realize that the data control is problably not the best way to do
it, but this is an existing app that i really don't want to redo if
possible.

Some stats.
VB version 5.0 sp3
Access 2002
DAO 3.6 referenced

Thanks for the help.

Jul 17 '05 #2
"Loop" <lo**@loop.com> wrote in message
news:Df*******************@newsread1.news.pas.eart hlink.net...
I could be mistaken, but isnt DISTINCT a shape operator....

"bhieb" <bh***@alanritchey.com> wrote in message
news:29**************************@posting.google.c om...
I have a data control that I write a sql statement on the fly and
populate the recordset like so.

Set Rst = Db.OpenRecordset("SELECT DISTINCT * FROM Source_UnitMaster
... join and where clause")
set dat_Equip.Recordset = Rst (this is a DAO recordset)

This gives me a "operation is not supported by this object" at the
second line.

Oddly if I remove the DISTINCT it does not error out. Even more
weird, if I remove a few fields from the Source_UnitMaster it works
with the DISTINCT.

<snip>

[Loop]:
DISTINCT is an ANSI SQL modifier to the SELECT statement, limiting the
resultset to unique rows only, if there are duplicate rows in the result.

[bhieb]:
I think that the JOIN and WHERE statements are important in this context,
so please post them too... Preferably a stripped-down, complete sample.

Also, which of the statements give you the error? The ".OpenRecordset()"
or the ".Recordset = Rst" part?

--
Dag.

Jul 17 '05 #3
YOu need to provide a column (field) name for the DISTINCT query, do not
use the wildcard.
I could be mistaken, but isnt DISTINCT a shape operator....

"bhieb" <bh***@alanritchey.com> wrote in message
news:29**************************@posting.google.c om...
I have a data control that I write a sql statement on the fly and
populate the recordset like so.

Set Rst = Db.OpenRecordset("SELECT DISTINCT * FROM Source_UnitMaster
... join and where clause")
set dat_Equip.Recordset = Rst (this is a DAO recordset)

Jul 17 '05 #4
bhieb wrote:
I have a data control that I write a sql statement on the fly and
populate the recordset like so.

Set Rst = Db.OpenRecordset("SELECT DISTINCT * FROM Source_UnitMaster
... join and where clause")
set dat_Equip.Recordset = Rst (this is a DAO recordset)

This gives me a "operation is not supported by this object" at the
second line.

Oddly if I remove the DISTINCT it does not error out. Even more
weird, if I remove a few fields from the Source_UnitMaster it works
with the DISTINCT.

As far as I can tell it seems to be a jet issue because the code works
fine in Access 2002. I read somewhere that VB 5.0 uses a diferrent
version of Jet than Access 2002.

Is there a size limit to the data control, if so how do I get around
this?

I realize that the data control is problably not the best way to do
it, but this is an existing app that i really don't want to redo if
possible.

Some stats.
VB version 5.0 sp3
Access 2002
DAO 3.6 referenced

Thanks for the help.


Don't you have to do a SET...NEW command first?

g
z
Jul 17 '05 #5
Sorry for taking so long to respond.

[Dag]
For testing purposes there is no WHERE clause just from [tableName].

[Niche]
It errors out at Set dat_Equip.Recordset = Rst

If I use field names it kinda works. If I remove any 4 fields it will
work, that is the weird part I ran into (see below snip). It does not
seem to matter which fields just any 4. Could it be a size
limitation?

(Snip)
"Even more weird, if I remove a few fields from the Source_UnitMaster
table it works with the DISTINCT."
Jul 17 '05 #6

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

Similar topics

4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.