comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Finding a structure in a structure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Finding a structure in a structure [message #28674] Mon, 07 January 2002 13:38 Go to next message
Pavel A. Romashkin is currently offline  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.
Re: Finding a structure in a structure [message #28767 is a reply to message #28674] Tue, 08 January 2002 06:24 Go to previous messageGo to next message
timothy.williams is currently offline  timothy.williams
Messages: 20
Registered: October 2001
Junior Member
By rectifying this directly in Access, do you mean converting the
format of the
field from Date/Time to Text? I tried that, but Access reformatted the
data from the Medium Date format, which is what I had in the original
table, to the General Date. I don't want to change the format of the
data, so I guess I have to do I myself. The Access people over here
say I can't change the way Access converts Dates to Text. (I suppose
this is another example of Bill making your decisions for you.)

The size() function completely slipped my mind. Thanks!

I don't really know as much as I should about Access, (or Oracle
either for that mattter), but I'll have databases on both, so I don't
want to depend on either. It just depends on which database the user
connects to as to which tables will be available.

Pavel A. Romashkin" <pavel_romashkin@hotmail.com> wrote in message news:<3C3A155A.FBD5339F@hotmail.com>...
> 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.
Re: Finding a structure in a structure [message #28768 is a reply to message #28674] Tue, 08 January 2002 06:24 Go to previous message
timothy.williams is currently offline  timothy.williams
Messages: 20
Registered: October 2001
Junior Member
By rectifying this directly in Access, do you mean converting the
format of the
field from Date/Time to Text? I tried that, but Access reformatted the
data from the Medium Date format, which is what I had in the original
table, to the General Date. I don't want to change the format of the
data, so I guess I have to do I myself. The Access people over here
say I can't change the way Access converts Dates to Text. (I suppose
this is another example of Bill making your decisions for you.)

The size() function completely slipped my mind. Thanks!

I don't really know as much as I should about Access, (or Oracle
either for that mattter), but I'll have databases on both, so I don't
want to depend on either. It just depends on which database the user
connects to as to which tables will be available.

Pavel A. Romashkin" <pavel_romashkin@hotmail.com> wrote in message news:<3C3A155A.FBD5339F@hotmail.com>...
> 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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Command line
Next Topic: Re: Null terminated strings

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:40:23 PDT 2025

Total time taken to generate the page: 0.00484 seconds