PRB: "Too Many Columns Defined in the Rowset" Err MsgID: Q192141
|
You get the following error when choosing a Recordset object:
Run-time error '-2147024882 (8007000e)' Too many columns defined in the rowset.
The client-cursor engine supports a maximum of 255 fields.
If possible, use a server-side cursor, or select fewer fields.
This behavior is by design. It is a design limitation of the client-cursor engine.
When you choose a disconnected recordset or specify a CursorLocation of
adUseClient, ActiveX Data Objects (ADO) invokes the client cursor engine to
handle record caching and scrolling. The cursor engine has a maximum limit of 255 fields. If the recordset contains more than 255 fields, the error
listed in the SYMPTOMS section appears.
By specifying a server-side cursor, you will be able to return more fields,
if your provider supports it.
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either express or implied, including but not limited to the implied
warranties of merchantability and/or fitness for a particular purpose.
Microsoft does not support modifications to this code.
The code listed in step four creates a dissociated recordset and saves the contents to disk.
Option Explicit
Const MAX_FIELDS = 256
Private Sub Command1_Click()
Dim rs As ADODB.Recordset, I As Long
Set rs = New ADODB.Recordset
For I = 1 To MAX_FIELDS
rs.Fields.Append "Field" & I, adInteger
Next I
rs.Open "C:\Test.Rst"
rs.AddNew
For I = 0 To MAX_FIELDS - 1
rs(I) = I
Next I
rs.Update
rs.Save
rs.Close
Set rs = Nothing
End Sub
For more information about ActiveX Data Objects, please refer to your
Microsoft Visual Studio documentation.
© Microsoft Corporation 1998, All Rights Reserved.
Contributions by Malcom Stewart, Microsoft Corporation
Additional query words: kbADO kbVBp500 kbVBp600 kbDatabase
Keywords : kbADO kbDatabase kbVBp500 kbVBp600
Version : WINDOWS:1.5,2.0,5.0,6.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: June 7, 1999