Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SaveAs() and SaveAsASCII() functions?

Status
Not open for further replies.

bentleygt

Programmer
Feb 24, 2004
16
US
I have a column in my DW that is a DDDW. When I want the user to export the data to a file I want them to have the display value instead of the data value. If I use the
SaveAs() function, the data value is exported. If I use the
SaveAsAscii() Function, the display value is exported. However, the SaveAsAscii() function does not allow for exporting to multiple types (i.e. text, excel, etc.). I want the user to have these multiple types. My idea to accomplish this is to create a datastore and save the contents of the dw to the datastore by looping through all the rows.

However, I want to use this for all my datawindows. All my datawindows have different column names/ data types. How do I save the dw contents to the datastore without setting up different datastores for each dw? Also, how do I determine if the column in the dw is a dddw so I then can get the display value for that column? I'm using PB6.5 .
 
You can dynamically set the dataobject in the datastore by first obtaining it from the datawindow and then assigning it to the datastore

string ls_dobj, ls_error
ls_dobj = dw_1.object.datawindow.syntax
ds_1.create(ls_ds_sql, ls_error)
IF (Len(ls_error) > 0 ) THEN
MessageBox ("Datastore create Error!", ls_error)
return -1
END IF
ds_1.settransobject(SQLCA)


As far as determining if a column is a DDDW you could use the describe method and check for any of the dddw properties of a column. If the column is not a dddw it would return a '?' instead of the property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top