Home All Groups Group Topic Archive Search About
Author
23 Aug 2006 2:45 PM
jonathandrott
i'm trying to find fields that don't have data by my constraints.  this
is not working in vb2005.

Dim dbAdapter As Odbc.OdbcDataAdapter = New
Odbc.OdbcDataAdapter("select PLU_NUM from Inv_Info where
UNITS_INPUR_UNIT =0 and PURCH_PLU <> '' ", connDB)

its two single quotes with a double quote at the end.

Author
23 Aug 2006 2:51 PM
Al Reid
jonathandr***@gmail.com wrote:
> i'm trying to find fields that don't have data by my constraints.
> this is not working in vb2005.
>
> Dim dbAdapter As Odbc.OdbcDataAdapter = New
> Odbc.OdbcDataAdapter("select PLU_NUM from Inv_Info where
> UNITS_INPUR_UNIT =0 and PURCH_PLU <> '' ", connDB)
>
> its two single quotes with a double quote at the end.

Try replacing the PURCH_PLU <> ''  with PURCH_PLU NOT IS NULL.

--
Al Reid
Author
23 Aug 2006 2:58 PM
Marina Levit [MVP]
Please define "not working". And I mean be specific, what exceptions,
errors, etc. What you expect to happen and what does.

"not working" does not really tell us anything at all.

<jonathandr***@gmail.com> wrote in message
Show quoteHide quote
news:1156344313.705237.209360@74g2000cwt.googlegroups.com...
> i'm trying to find fields that don't have data by my constraints.  this
> is not working in vb2005.
>
> Dim dbAdapter As Odbc.OdbcDataAdapter = New
> Odbc.OdbcDataAdapter("select PLU_NUM from Inv_Info where
> UNITS_INPUR_UNIT =0 and PURCH_PLU <> '' ", connDB)
>
> its two single quotes with a double quote at the end.
>
Author
23 Aug 2006 2:58 PM
tommaso.gastaldi@uniroma1.it
Your title seems in contradiction with your code.

Also vb2005 has nothing to do with it. see the SQL language of your
DBMS.

In vb: it would be  System.Convert.DBNull. In sql usually you often
have ISNULL.

If you are checking for zero length string or spaces you may want to
use
some trim function made available by your sql to deal with spaces too.

Tommaso

jonathandr***@gmail.com ha scritto:

Show quoteHide quote
> i'm trying to find fields that don't have data by my constraints.  this
> is not working in vb2005.
>
> Dim dbAdapter As Odbc.OdbcDataAdapter = New
> Odbc.OdbcDataAdapter("select PLU_NUM from Inv_Info where
> UNITS_INPUR_UNIT =0 and PURCH_PLU <> '' ", connDB)
>
> its two single quotes with a double quote at the end.