Re: Finding a structure in a structure [message #28674] |
Mon, 07 January 2002 13:38  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
I see two ways of handling this.
First, you can rectify this directly in Access when you are working with
the recordset (of which, rightfully, you said nothing in your post, as
it is not dealing with IDL).
In IDL - since you already havi the Recordset structure in it - I would
try the following:
for i = 0, n_tags(recordset)-1 do begin
; Convert date to Access format, to string, if field is a Structure
if size(recordset.(i), /type) eq 8 then $
Convert, recordset.(i) ; This is *your* conversion routine
; Ignore this field of Recordset if not a Structure
else ....
endfor
Personally, I can't imagine trying to mix IDL widgets with VBA and
Access' forms. The latter offer tremendously more flexibility with
regard to database analyses.
hope this helps,
Pavel
Tim Williams wrote:
>
> I have an application that is using Dataminer to access a database,
> one of the functions being to display the tables in the database. So
> far, my database has been Oracle on a Sun, where my IDL on a PC. I'm
> now migrating over some of the tables to Access on the PC. I now have
> a problem because one of my fields has a date in it which was a STRING
> before, but in the Access database is the structure
> ODBC_SQL_TIMESTAMP. I'm getting an error that structures can't contain
> other structures.
>
> My plan now is to write code to convert this structure to a string so
> I can put the date in the table widget structure.
>
> How? I can do a tag_names(recordset, /structure_name) and test for
> 'ODBC_SQL_TIMESTAMP', but I'm not sure how to search through each
> member in the database recordset structure. I don't know how to handle
> the errors I will have when I call tag_names() with the members that
> aren't structures.
>
> Thanks for any help.
|
|
|