Jill,

The querymode service is saving the file Ok.
What it basically does is to save all the "query" data - the user entered query - as a 
tab separated data text file.
When you do of_load it imports back the data into the datawindow. But for both these 
the querymode service must be
instantiated and the datawindow must be in querymode at the time these two operations 
are performed.

HTH
Sameer

-----Original Message-----
From:   Jill M. Claus [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, September 28, 1999 2:35 AM
To:     [EMAIL PROTECTED]
Subject:        Re: PFCSIG:  n_cst_dwsrv_querymode

Thank you for your response Sharon.   In answer to your questions...

dw_1 is the name of my datawindow control, so that should be OK.  Also, there is no 
other code in the command buttons.

I hadn't originally set the of_SetQueryMode(TRUE) in my constructor event, but  
another PFCSIG user suggested this and I tried it.  That made the null error go away, 
and the file open/save dialogue boxes open appropriately now.  However, as I told him, 
I now have a new problem.  The of_save doesn't appear to do what I would have 
expected.  If I put "7/31/99" under the field called date, then the save dialogue box 
simply saves the "7/31/99" into a text file.  Then the load button doesn't appear to 
do anything at all.   Do you know what the file the of_save function creates should 
look like if opened with something like notepad?

Jill Claus   (842-4369)
Financial Information Management


>>> Sharon Buntz <[EMAIL PROTECTED]> 09/27/99 04:12PM >>>
Jill,

This may seem elementary, but sometimes that's the hardest to see...

1)  Did you change "dw_1" to your appropriate target DW control name?

2)  Did you code of_SetQuerymode(TRUE) for your target DW control?

3)  Before you can "Save" a query, QueryMode must first be enabled (i.e.
your user must be in QueryMode to "Save" a query.  So we normally
disable/enable our command button appropriately.

When does your null object reference error occur?  Do you ever see the
system Open File dialog window appear (the one that will get the user's
filename selection)?  Any other code in the button?

Any other suggestions?  

Good luck - Let us know what it is when you figure it out.

Have fun,
~Sharon
--
Sharon Weinstrom Buntz      | mailto:[EMAIL PROTECTED] 
Cheat Sheet for PFC/PB Help | http://www.pfccheatsheet.com/ 


"Jill M. Claus" wrote:
> 
> I am using Powerbuilder 6.5 and Sybase 11 on NT.
> 
> I created a window that uses the n_cst_dwsrv_querymode service and it works well.  
>However, I want to add the functionality to it that will allow users to save and load 
>the queries they create.
> 
> Online help provides the following example:
> 
> FOR SAVE:  ( I put this in a cb_save command button on the window)
> String    ls_path_name, ls_doc_name
> ls_path_name = "c:\temp\rkn.txt"
> dw_1.inv_querymode.of_Save ("Save a Query", ls_path_name, ls_doc_name)
> 
> FOR LOAD:  ( I put this in a cb_load command button on the window)
> Integer   li_return
> String    ls_path_name, ls_doc_name
> ls_path_name = "c:\temp\rkn.txt"
> dw_1.inv_querymode.of_Load ("Load a Query", ls_path_name, ls_doc_name)
> 
> But when I put the above in the onclick for the two respective command buttons, I 
>get a null object reference error in both cases.
> 
> Does anyone know how this should be done?
> 
> Any help would be greatly appreciated,
> Jill Claus
> 
> Jill Claus   (842-4369)
> Financial Information Management

> [EMAIL PROTECTED] HOSTED BY IIGG, INC. FOR HELP WITH LIST SERVE COMMANDS, ADDRESS
> A MESSAGE TO [EMAIL PROTECTED] WITH THE FOLLOWING MESSAGE:   help pfcsig
> SEND ALL OTHER INQUIRES TO [EMAIL PROTECTED]
> [EMAIL PROTECTED] HOSTED BY IIGG, INC. FOR HELP WITH LIST SERVE COMMANDS, ADDRESS
> A MESSAGE TO [EMAIL PROTECTED] WITH THE FOLLOWING MESSAGE:   help pfcsig
> SEND ALL OTHER INQUIRES TO [EMAIL PROTECTED]

Reply via email to