|
-
Aug 28th, 2000, 11:56 AM
#1
Thread Starter
New Member
Anyone know why a sort cannot be applied to a
column of a recordset that is of type "adBSTR"?
All I get with the following line is, "Sort order
cannot be applied." there are three rows of data
in the recordset already and each has a value for
all columns including this "FavColor" column.
Code:
rs.Sort = "FavColor"
=========================
George Walley
Northwestern, University
Chicago, IL
-
Aug 28th, 2000, 12:08 PM
#2
Thread Starter
New Member
Don't use adBSTR...
Ok, i've fixed my problem, but for anyone else who tries
to do the same thing, be sure to use "adVarChar" or the
like because sorting a adBSTR doesn't seem to work.
Also, in order to append a new column as a type "adVarChar"
(or similar type), be SURE to specify a size or it will
give you errors as well...even though it doesn't tell you
that that's a required parameter.
Thus use something like:
Code:
With rs
.Fields.Append "FName", adVarChar, 20 '<-- the size is
.Fields.Append "BirthDate", adDate ' critical
.Fields.Append "FavColor", adVarChar, 20
End With
'Instead of:
With rs
.Fields.Append "FName", adBSTR
.Fields.Append "BirthDate", adDate
.Fields.Append "FavColor", adBSTR
End With
=========================
George Walley
Northwestern, University
Chicago, IL
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|