Trying to get ADO to work!... frustrated =/ 
Author Message
 Trying to get ADO to work!... frustrated =/

Coming from ASP/VB I am finding that the jump to Delphi isnt all that
difficult and I am happy to be here after noticing several performance gains
in one environment versus the other.

I am now at a point where I am stumped.  Knowing ADO and it's uses in VB, I
am attempting to pull off a .GetRows on the recordset object to retrieve the
records as opposed to a .movenext loop.  Problem is, I haven't the foggiest
idea how to handle this oleVariant array of oleVariants.  What happened to
just being able to call the .GetRows and then run a for next loop to yank
out the values that I need?

Any help would be greatly appreciated.  I have searched all over the web and
the samples/examples I am finding aren't geared to ADO specifically (many
documents on TStringLists and such) but in trying them, they still wouldnt
work to read the array elements.  Maybe someone has a link or knows the
exact one or two lines that I am looking for.

Thanks!
Ben



Sun, 01 Jan 2006 22:38:10 GMT
 Trying to get ADO to work!... frustrated =/

If the OLE object supports a "GetRows" property/method then you should
be able to use that in Delphi. If you declare a variant and it's an
array then you should be able to simply use it.  Is the nature of your
problem perhaps "how to declare things?"  Please elaborate to the
group.  

Delphi includes things like TStringLists and so-on having various uses,
but in your case (working basically all-the-time with OLE/Variant
variables) you probably won't be using these.  Delphi has "variant
arrays" and a search for this topic in its online help might get you
started down the right course.

Quote:

> Coming from ASP/VB I am finding that the jump to Delphi isnt all that
> difficult and I am happy to be here after noticing several performance gains
> in one environment versus the other.

> I am now at a point where I am stumped.  Knowing ADO and it's uses in VB, I
> am attempting to pull off a .GetRows on the recordset object to retrieve the
> records as opposed to a .movenext loop.  Problem is, I haven't the foggiest
> idea how to handle this oleVariant array of oleVariants.  What happened to
> just being able to call the .GetRows and then run a for next loop to yank
> out the values that I need?

> Any help would be greatly appreciated.  I have searched all over the web and
> the samples/examples I am finding aren't geared to ADO specifically (many
> documents on TStringLists and such) but in trying them, they still wouldnt
> work to read the array elements.  Maybe someone has a link or knows the
> exact one or two lines that I am looking for.



Mon, 02 Jan 2006 06:51:26 GMT
 Trying to get ADO to work!... frustrated =/

Quote:

> Coming from ASP/VB I am finding that the jump to Delphi isnt all that
> difficult and I am happy to be here after noticing several performance gains
> in one environment versus the other.
> I am now at a point where I am stumped.  Knowing ADO and it's uses in VB, I
> am attempting to pull off a .GetRows on the recordset object to retrieve the
> records as opposed to a .movenext loop.  Problem is, I haven't the foggiest
> idea how to handle this oleVariant array of oleVariants.  What happened to
> just being able to call the .GetRows and then run a for next loop to yank
> out the values that I need?
> Any help would be greatly appreciated.  I have searched all over the web and
> the samples/examples I am finding aren't geared to ADO specifically (many
> documents on TStringLists and such) but in trying them, they still wouldnt
> work to read the array elements.  Maybe someone has a link or knows the
> exact one or two lines that I am looking for.

ADO may be very different from the component sets I've been using, but my code
in Delphi usually follows this pattern.
(The query (q) holds a SELECT statement in the SQL property)

q.Open;
while not q.Eof do
begin
  ID := q.FieldByName('ID').AsInteger;
  NAME := q.FieldByName('NAME').AsString;
// do important stuff
  q.Next;
end;
q.Close;

This may be totally irrelevant to your (ADO) case, but maybe it shows the
corresponding verbs for doing GetRows and MoveNext.

Regards,
Aage J.



Mon, 02 Jan 2006 15:11:10 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. frustrating - trying to insert values to a DB from a servlet and it doesnt work

2. Getting an Error 429 when trying to create an ADO connection

3. Distributed Transaction Failing on First Try, Second Try Works

4. Getting the RecordCount using ADO (Only works Sometimes!!)

5. Getting ADO Sort property to work with Server Side Cursors

6. Getting ADO Sort property to work with Server Side Cursors

7. Frustrated W/ ADO

8. I have tried and tried.... and tried

9. Keep getting authentication failure when trying to restore database

10. Getting an error when trying to reattach db.

11. Getting the following error when trying to copy a database from one server to

12. FIXED: Please help - Keep getting authentication failure when trying to restore database


 
Powered by phpBB® Forum Software