Re: get multivalued data from a Recordset

From: Stephen Howe (stephenPOINThoweATtns-globalPOINTcom)
Date: 01/24/05


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



Relevant Pages

  • Re: ADODB RECORDSET Optimierung
    ... Recordset mit einem Static Cursor öffnest? ... Damit zwingst Du ADO die ganze Tabelle in den Speicher einzulesen und eine Kopie aller Records anzulegen. ...
    (microsoft.public.de.access.clientserver)
  • Re: using ado to query the contents of a spreadsheet
    ... The first time the zipcode appears it is set up as xxxxx-xxxx and then ... So this would imply that it is not the ADO ... Is there any way to force ADO to make everything be a string no matter ... 'Create the reference to the ado recordset ...
    (microsoft.public.excel.programming)
  • Re: using ado to query the contents of a spreadsheet
    ... The first time the zipcode appears it is set up as xxxxx-xxxx and then ... So this would imply that it is not the ADO ... Is there any way to force ADO to make everything be a string no matter ... 'Create the reference to the ado recordset ...
    (microsoft.public.excel.programming)
  • Re: using ado to query the contents of a spreadsheet
    ... Try adding Imex option to connection string for mixed values that is the only ... It is not hard to run a simple macro in front of your ADO code that converts ... Not the most ideal solution when you have a lot of worksheets and the ... 'Create the reference to the ado recordset ...
    (microsoft.public.excel.programming)
  • Re: ADO Data Control Concurrency Problem
    ... >> Editing of row in table is done with the help of ADO Data Control. ... Cursor location does not bare on whether the ... Client or Server memory. ... reflected in the open recordset. ...
    (microsoft.public.vb.general.discussion)