Re: PowerObjects - HELP!

From: Mohamad Nazri Shuib <mnshuib_at_gware.po.my>
Date: 1996/01/05
Message-ID: <4ci84c$hqt_at_jaring.my>#1/1


Tom Cooke <Tom_at_tomcooke.demon.co.uk> wrote:
>This is probably quite simple, but is one of those frustrating things
>that hold you up when you're first starting with a new language. I'm
>trying to set up a query condition to use with the QueryWhere() method,
>and the object of the exercise is to return only those rows where the
>value of a column is equal to the literal value of a non-database field
>on the current form. I'm obviously doing something wrong, as the commonest
>error I get is "<formname>.<field>.Value is not a valid column name".
>I've tried putting quotes round things (using chr(34), as I couldn't
>figure out a way of embedding quotes in strings yet), but this either
>makes no difference or - oddly - I get an error telling me that my
>string literal, quotes and all, isn't a valid column name. Any ideas,

You did not say whether you are trying to set the query condition in Oracle Basic or in the property window.
In Oracle Basic what I normally do is

   frmTest.QueryWhere("colname=50") 'if datatype is number

or

   frmTest.QueryWhere("colname='abc'") 'if datatype is string

If you want to set the condition to a variable:

   frmTest.QueryWhere("colname=" & v_integer)

or

   frmTest.QueryWhere("colname='" & v_string & "'")

If you are setting the condition in the property sheet, in the QueryWhere property, type in

   colname=50

or

   colname='abc'

>anyone? While I'm on the subject, is there an easy way to make Power
>Objects behave like Forms(3/4/4.5) i.e. let the user put the whole form
>into query mode? I've tried Query-By-Form, but don't like it much. An
>interesting "feature" also of QBF is that if your form has a check box,
>QBF will only return rows with the value of the check box in the query
>form; I haven't found a way of telling it "I haven't typed anything in
>here, so I don't care what value it is, just like the other fields".
>Again, if anyone knows a way around this, I'd be grateful to hear.

I have not tried this one yet. From what I know of Oracle Power Objects, query mode is handled by a different form. If you press the Query button on the toolbar, it will give you another screen similar to the one you are currently running and you can type in your query.

Another way of doing it is by having all the fields from the table in a form but not tying the RecordSource and DataSource to any tables and columns. Put a button at the bottom that does a Query in the Click method.

>--
>Tom Cooke

-- 
Mohamad Nazri Shuib                     E-mail: mnshuib_at_gware.po.my
GroupWare 2000 Sdn Bhd                  Tel: (603) 253-5331
19G Medan Setia 1                       Fax: (603) 253-9927
Plaza Damansara
Bukit Damansara
50490 Kuala Lumpur
MALAYSIA
Received on Fri Jan 05 1996 - 00:00:00 CET

Original text of this message