Re: get multivalued data from a Recordset
From: Stephen Howe (stephenPOINThoweATtns-globalPOINTcom)
Date: 01/24/05
- Next message: Stephen Howe: "Re: Transactions."
- Previous message: Stephen Howe: "Re: Index and Deleted"
- In reply to: stanley: "get multivalued data from a Recordset"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 24 Jan 2005 18:02:40 -0000
> how can i deal with multivalued fields (field type = adVariant)
> i need to get data from a field with type adVariant and convert it to
string
> or array of strings (it is data from the ActiveDirectory and not from sql
> sever !!!- the provider is 'ADSDSOObject')
> i am using c++ and working with ado on win xp
Don't know but I use ADO & C++ every day.
But I know what I would do. I would see how far I could get.
1) Can you get a valid Connection going?
2) If yes, can you get Recordset Open() if you try opening a table or issue
an SQL command ("SELECT * FROM DirectoryObject" or SP (i.e. whatever happens
to be valid command for provider 'ADSDSOObject') for a Recordset?
For a Recordset Open() make sure you specify
CursorType,LockType,CursorLocation and all other Open() options (DO NOT use
the defaults).
2i) I would try a Server-sided,Forward-Only,Read-only cursor first.
2ii) I would also try a Client-sided,Static,Read-only cursor second just to
see if client-sided cursors work.
2iii) If 2i) and/or 2ii) work, I would also try seeing if a LockOptimistic
cursor works (i.e. can you get an updatable RecordSet)
3) If you manage to do a successful Recordset Open(), I would print off the
CursorType and LockType AFTERWARDS to see what ADO _really_ returned.
4) If you managed to do successful Recordset Open(), you are not at EOF, I
would inspect the Fields, look at the types of the fields. My guess would be
that if supported, you would have to do some inspection vt_Variant and
casting to get the values and types you want.
At least that is how I would proceed (as well as sifting through MSDN to
see if there are any articles saying if this cannot be done).
It could be that ADO issues an error on Recordset Open() and it is not
possible.
Stephen Howe
- Next message: Stephen Howe: "Re: Transactions."
- Previous message: Stephen Howe: "Re: Index and Deleted"
- In reply to: stanley: "get multivalued data from a Recordset"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|