How to pass string indexes for OleVariant

I'm converting the following example code to Delphi:

My code is something like:

  vTable, vRow: OleVariant;

  while vTable.EndOfTable = False do
    vRow := vTable.GetNextRow;
    sEmail := vRow['Email1Address'];

The problem is that I need to pass a string index, 'Email1Address', but Delphi gives the error: Incompatible types: Integer and string.

Should I be using a different type of variant?



I've taken a look at the Outlook unit generated from a TLB file and it looks like this:

_Row = interface(IDispatch)
    function Item(Index: OleVariant): OleVariant; safecall;

The Row interface has a method Item, which takes an OleVariant. So use this:

sEmail := vRow.Item('Email1Address');

Also take a look at the MSDN help.

Need Your Help

Purpose of using projections in vertica database

database database-design data-warehouse vertica

I have a vertica database that using projections. I read vertica docs but docs generally talk about how to issue;

Is it possible to set spring security session expiration by age?

spring-security session-timeout

I am trying to get a spring security session to expire after 30 minutes from log in. I do not want the timeBeforeExperation to be reset after every interaction.