473,399 Members | 4,254 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,399 software developers and data experts.

80004005 too many columns selected

Posting a solution to a problem I had.
In the the following code I was getting an error something like "80004005
too many columns selected"
After long time searching the a2k help and this NW, I found the error. The
query string I was using to build the RS hadn't all the table fields! When I
select all the fields, even if I don't want to all the fields!
So here it is, in case it helps someone.

BTW, with an UPDATE query I had no problem having the work done. The thing
is, I dind't find out how to use an update query and having transactions at
the same time.

RV

sub abc()
Dim cnn As ADODB.Connection
Dim cnnStr, sSQL
Dim rs As ADODB.Recordset

Set cnn = CurrentProject.Connection 'BTW, is this a recommend
approach or shall I define my own cnnStr?

Set rs = New ADODB.Recordset
rs.ActiveConnection = cnn
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockPessimistic

'this query string works fine
sSQL = "select * from my_table whey my_key=112233;" 'instead of *,
the list of fields would be better!

'this query string was making the problem
'sSQL = "select field1, field2 from my_table whey my_key=112233;"

rs.Open sSQL
rs.MoveFirst
cnn.BeginTrans
While Not rs.EOF
rs("field1") = 123
rs("field2") = "abc"

rs.Update 'the error was showing up here. And yes, these two
fields where changed for all rows of the table!

rs.MoveNext
Wend
cnn.CommitTrans
rs.Close
Set cnn = Nothing
end sub
Nov 13 '05 #1
0 1232

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

Similar topics

1
by: Richard | last post by:
I have been programming in Access and HTML for several years and have decided to put these together by adding ecommerce to my site in ASP. I bought a template from ecommercetemplates and just need...
3
by: Shawn | last post by:
Hi guys, I'm trying to compose a query that will select all columns from a table, but without any duplicates. E.g. table name is 'tblShipment' columns are: fldUnique(pk) | fldShipNo |...
4
by: Bryan Tang | last post by:
I built an ASP to search the content in index server. It is ok if search in English. Whenever I search in Chinese, I will got the following error message, CreateRecordset ?u?~ '80004005' ...
4
by: Sherwood Botsford | last post by:
Table Markers ID (Primary Key) This&That PointClass (Combo box) Points Table PointClasses PointClass (primary key) Points (number) Description (Text)
3
by: strauss.sean | last post by:
To all: Here's an interesting one: I have a query that produces 56 (!!) columns of data. The first three columns are "to repeat at left", as can be selected in Excel at File --> Page Setup -->...
5
by: John Devlon | last post by:
Hi, Does anyone know how to get a value of a second column of a selected item in Listview. I've create a listview and added this code Listview.Items.Clear() Listview.Columns.Clear()...
1
by: ziottt | last post by:
Hi everybody My problem with sql server is the following one: I've got my backoffice manager application done with asp technology that works on sql server installed on Win2000 and running on IIS5....
9
by: Earl | last post by:
I have somewhat of an interesting scenario: The form allows the user to select a service, which populates a a grid of product information related to that service ("service grid"). The user can...
2
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
Based on wether a row is selected in a GridView I need to HIDE the last two columns of a gridview. I do NOT need to make the cells invisible I want to hide the entire column. When I set the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
agi2029
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 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.