Jules Needleman
August 4th, 1999, 11:27 PM
I am creating a recordset within my VB6 program using the ADO control.
I would like to append fields of variable length strings.
Could someone provide sample code of this.
Currently, this is a sample of my code:
r.Fields.Append "Field1", adChar, 25
r.Fields.Append "Field2", adChar, 14
r.Fields.Append "Field3", adChar, 255
r.Fields.Append "Field4", adChar, 25
r.Fields.Append "Field5", adChar, 25
r.Fields.Append "Field6", adChar, 25
This code works, but the fields are of fixed lengths.
If I change the code to the following, I get a runtime error when trying to
sort the field.
r.Fields.Append "Field1", adBSTR
r.Sort "Field1"
The error message is "The requested order could not be opened"
I would like to be able to sort a variable length string.
Is that possible?
If so, how would I create the recordset so that this would work?
Any help would be greatly appreciated.
Thanks
I would like to append fields of variable length strings.
Could someone provide sample code of this.
Currently, this is a sample of my code:
r.Fields.Append "Field1", adChar, 25
r.Fields.Append "Field2", adChar, 14
r.Fields.Append "Field3", adChar, 255
r.Fields.Append "Field4", adChar, 25
r.Fields.Append "Field5", adChar, 25
r.Fields.Append "Field6", adChar, 25
This code works, but the fields are of fixed lengths.
If I change the code to the following, I get a runtime error when trying to
sort the field.
r.Fields.Append "Field1", adBSTR
r.Sort "Field1"
The error message is "The requested order could not be opened"
I would like to be able to sort a variable length string.
Is that possible?
If so, how would I create the recordset so that this would work?
Any help would be greatly appreciated.
Thanks