mkmko
asked on
Delphi 7 LDAP via ADO / Field type
Hi all,
this is a question for legacy Delphi - I have to use D7 for this small project. I need to use some values from LDAP records, so I'm using a SQL query in a 'TBetterADODataSet' to retrieve my data. Later on, I want to display it in a grid and use some of those data in a report. But I don't have a plan how to use fields being obviously strings, but are inserted as TVariantField. This is the case for 'description', which holds the additional text information for a person in our AD.
When I'm adding that field to my SQL command and trying to insert it into my field list, it always inserts as 'TVariantField'. My grid can't use that field type.
Any ideas or workarounds? Sorry - I'm no longer doing my daily D7 programming for some years now, so there's some lack in experience :(
TIA
Michael
this is a question for legacy Delphi - I have to use D7 for this small project. I need to use some values from LDAP records, so I'm using a SQL query in a 'TBetterADODataSet' to retrieve my data. Later on, I want to display it in a grid and use some of those data in a report. But I don't have a plan how to use fields being obviously strings, but are inserted as TVariantField. This is the case for 'description', which holds the additional text information for a person in our AD.
When I'm adding that field to my SQL command and trying to insert it into my field list, it always inserts as 'TVariantField'. My grid can't use that field type.
Any ideas or workarounds? Sorry - I'm no longer doing my daily D7 programming for some years now, so there's some lack in experience :(
TIA
Michael
ASKER
Sorry for the delay... no, unfortunately this doesn't work. I have to translate the exception message because of my german Delphi installation: 'Error variant of type (array variant) couldn't be converted into type (string)'.
I checked that the ShowMessage is used and placed correctly by testing FieldByName('anotherString Field').As String. This will work.
Michael
I checked that the ShowMessage is used and placed correctly by testing FieldByName('anotherString
Michael
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, this works! Great!
Thanks a lot.
Michael
Thanks a lot.
Michael
I suspect you can deal with similarly to when trying to show Memo fields in a DBGrid.
Can you test if "ShowMessage(urDataSet.Fie