🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.database
Article #219

Re: QueryDataSet: How to do "trial" query and accept or decline

#219
From: Mehmet F. Erten
Date: Wed, 19 Jul 2006 15:32
64 lines
3357 bytes
You must renew the QueryDataSet otherwise it also points the one in the 
hashmap.
Otherwise it will work; I use this logic many times and works.

actualqds= new QueryDataSet(with the new Query String).
Before modifying with any new querystring.

"John T. Dow" <john@johntdow.com> wrote in message 
news:Xns980571EA9B000johnjohntdowcom@207.105.83.66...
> Thanks for the suggestion, which I tried. Unfortunately it's not working.
>
> Before changing the query string, I did this:
>
>    HashMap saveqds = new HashMap();
>    saveqds.put("SAVE", actualqds);
>
> When wanting to revert to the original, I did this:
>
>    actualqds = (QueryDataSet) saveqds.get("SAVE");
>
> Having done this, the query string has not reverted and the row count
> remains 0.
>
> John
>
>
>
>
> "Mehmet F. Erten" <mehmet_erten@mblsoft.com> wrote in
> news:44be3b53$1@newsgroups.borland.com:
>
>> Hi,
>> Try this.
>>
>> hasmap or treemap myMap
>> myMap.put("OLD", currentQueryDataSet)
>> currentQueryDataSet = new QueryDataSet(with the new Query String).
>> If you don't like it. (if getRowCouunts == 0)
>> currentQueryDataSet = (QueryDataSet) myMap.get("OLD");
>>
>> "John T. Dow" <jo
>> hn@johntdow.com> wrote in message
>> news:Xns98053677CC68Cjohnjohntdowcom@207.105.83.66...
>>> Is it possible to change a querydataset's query string and execute
>>> the query, and then revert to the original query string with the
>>> original rows and cursor position without having to reexecute with
>>> the original query string?
>>>
>>> I have an application where the user can easily create new queries on
>>> the fly. As I have developed it so far, if the user tries a new
>>> query, he loses
>>> the old. I would like to be able to revert to the old query, for
>>> example if
>>> the new query fails to find any rows.
>>>
>>> Is it possible to do something clever like saving the original
>>> QueryProvider? Can you clone the entire qds, change the query string
>>> etc, and then if you like the outcome substitute the new qds for the
>>> old?
>>>
>>> John
>>
>>
> 
Technical Details
Message-ID: <44be507e$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.190.247.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!news-out.usenet.com!sp6iad.superfeed.net!in1.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <Xns98053677CC68Cjohnjohntdowcom@207.105.83.66> <44be3b53$1@newsgroups.borland.com> <Xns980571EA9B000johnjohntdowcom@207.105.83.66>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1073da,3b0213ebece65c18
X-Google-Attributes: gid1073da,public
X-Google-Language: ENGLISH,ASCII-7-bit
Subject: Re: QueryDataSet: How to do "trial" query and accept or decline
From: "Mehmet F. Erten" <mehmet_erten@mblsoft.com>
Date: Wed, 19 Jul 2006 11:32:11 -0400
Message-ID: <44be507e$1@newsgroups.borland.com>
References: <Xns98053677CC68Cjohnjohntdowcom@207.105.83.66> <44be3b53$1@newsgroups.borland.com> <Xns980571EA9B000johnjohntdowcom@207.105.83.66>
Lines: 66
NNTP-Posting-Host: 70.90.110.46
Organization: MBL Systems, Inc
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.190.247.MISMATCH!news-out.readnews.com!news-xxxfer.readnews.com!news-out.usenet.com!sp6iad.superfeed.net!in1.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
Newsgroups: borland.public.jbuilder.database
X-Trace: newsgroups.borland.com 1153323134 70.90.110.46 (19 Jul 2006 08:32:14 -0700)
Reply-to: "Mehmet F. Erten" <mehmet_erten@mblsoft.com>
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original