how do we check the nullity of a string

R

ravindar thati

hello friends,
i am using ms access 2003,
i have a couple of doubts

1. how do we check the nullity of string with vb6 code
2. when we use the code
MsgBox(" hello world"), then hello world will be displayed.
now i want to embedded double quotation marks in the output
messsge
i.e for example i want the out put as
hello "the" world.

i mean the output should include quotation marks too.
how can i accomplish this?

thanq
 
G

Guest

Too check the nullity of a variable simply use isnull()

if isnull(varname) then
....

As for quotations, if you absoltely want them you'll need to add them
yourself by concatenating your output. Something like

Output = chr(34) & varname & chr(34)

In the case of a msgbox then your probably best creating a string and then
using it in the msgbox.

strMsg= chr(34) & "Hello World" & chr(34)
msgbox strMsg,vbOk,"Message Box Title Goes Here"

This way you can build your textadding quote around the text you choose.
 
B

Bob Hairgrove

hello friends,
i am using ms access 2003,
i have a couple of doubts

1. how do we check the nullity of string with vb6 code

There is a difference between "null" and a zero-length string
(sometimes called a "ZLS"). In VB6 and VBA, string variables and
literals are never null; however, if a text column is nullable,
reading the value of that column from a recordset might return Null.

To check for Null, use the IsNull() function. To check for a ZLS, use
the Len() function.
2. when we use the code
MsgBox(" hello world"), then hello world will be displayed.
now i want to embedded double quotation marks in the output
messsge
i.e for example i want the out put as
hello "the" world.

i mean the output should include quotation marks too.
how can i accomplish this?

thanq

Just double up the quotes:
MsgBox("hello ""the"" world")
 
G

Guest

To embedd a qoute, doulbe the quote:
MsgBox "Hello ""The"" World"

Will display: Hello "The" World

When you say nullity, it could be two things. To check for a null value,
use the IsNull function. If you want to check for an empty string use the
vbNullString contstant.
 
R

ravindar thati

To embedd a qoute, doulbe the quote:
MsgBox "Hello ""The"" World"

Will display: Hello "The" World


thanq friends, for your valuable information.

i have one more doubt please.

if we want to print a interger vairble say i, with the code Msgbox,
we use MsgBox(i)

but if want to display some text together with the value of i, what
should i do?
 
R

ravindar thati

To embedd a qoute, doulbe the quote:
MsgBox "Hello ""The"" World"

Will display: Hello "The" World


thanq friends, for your valuable information.
i have one more doubt please.

i we want to display an interger value say i, with MsgBox,
we use the code MsgBox(i).
but i want to display some text together with the value of i in the
same message.
how can i accomplish this?
thanq
 
R

ravindar thati

thanq friends.

i have one more doubt.

to display an integer value say i, with MsgBox,
we use the code MsgBox(i).

but i want to display some text together with the value of i in the
same message.

how can i accomplish this.
thanq
 
R

ravindarbtech

To embedd a qoute, doulbe the quote:
MsgBox "Hello ""The"" World"

Will display: Hello "The" World

When you say nullity, it could be two things. To check for a null value,
use the IsNull function. If you want to check for an empty string use the
vbNullString contstant.



thanq friends.

i have one more doubt.
if we want to display an interger variable value say i, we use the
code MsgBox(i).

but i want to display some text together with the value of i in the
same message.
how can i accomplish this





i have faced a problem in posting reply to this thread. when i logged
in with my id , and post my replies it says that "your post was
successful", but the post is not displayed later. i have been tried
for around 10 times to post a reply now. but i couldnt do it.
what could be the problem?
now i logged in with different ID and replying the messages


thanq
 
B

Bob Hairgrove

thanq friends, for your valuable information.

i have one more doubt please.

if we want to print a interger vairble say i, with the code Msgbox,
we use MsgBox(i)

but if want to display some text together with the value of i, what
should i do?

It's really not necessary to post questions four different times.

Try reading about the text concatenation operator ("&") in the help
file.
 
G

Guest

MsgBox i & " SomeText"

If you want a specific format for i,
MsgBox Format(i, "##0") & " SomeText"
 
R

ravindarbtech

On 16 May 2007 21:56:02 -0700, ravindar thati
It's really not necessary to post questions four different times.

i have not asked that question in 4 different ways. actually the
problem was, yesterday this group was not active since morning and if
we post a message it said that the post was successful, but the
message was not displayed after a moment.

so i was in dilemma and posted repeatedly.
actually i posted these msgs yesterday morning. but unfortunately the
msg were diplayed after a long delay, i.e in the evening.

thanq
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top