|
 |
asp_databases thread: SV: Data returned from Access as True/False not Yes/No
Message #1 by =?iso-8859-1?Q?H=E5kan_Frennesson?= <hakan@c...> on Wed, 12 Sep 2001 21:41:06 +0200
|
|
Hi!
You can do like this:
if rs("youryesnofield")=true then
response.write "Yes"
else
response.write "No"
end if
There might be other ways..
Hakan
-----Ursprungligt meddelande-----
Från: Ken Dowling [mailto:ken.dowling@o...]
Skickat: den 12 september 2001 17:52
Till: ASP Databases
Ämne: [asp_databases] Data returned from Access as True/False not Yes/No
Hi All,
I hope you can help with this one. I have an access 2000 db with yes/no
fields. I query the db through asp and get my results back. e.g. Select *
from table where ...
However, when my results are displayed the yes/no fields from the access
db now display as true/false. The field types within access are set to
yes/no. How can I set the data return to be yes/no.
Any ideas would be really appreciated.
Regards,
Ken Dowling
Message #2 by Steve Carter <Steve.Carter@t...> on Thu, 13 Sep 2001 11:15:06 +0100
|
|
I use the following function a lot to keep code concise:
function iif(condition,trupart,falpart)
if condition then
iif=3Dtrupart
else
iif=3Dfalpart
end if
end function
iif is actually built-in to access and I was surprised not to find it
in
VBScript.
Then your code looks like this:
response.write iif(rs("youryesnofield"),"Yes","No")
> -----Original Message-----
> From: H=E5kan Frennesson [mailto:hakan@c...]
> Sent: 12 September 2001 20:41
> To: ASP Databases
> Subject: [asp_databases] SV: Data returned from Access as
> True/False not
> Yes/No
>
>
> Hi!
>
> You can do like this:
>
> if rs("youryesnofield")=3Dtrue then
> response.write "Yes"
> else
> response.write "No"
> end if
>
> There might be other ways..
>
> Hakan
>
> -----Ursprungligt meddelande-----
> Fr=E5n: Ken Dowling [mailto:ken.dowling@o...]
> Skickat: den 12 september 2001 17:52
> Till: ASP Databases
> =C4mne: [asp_databases] Data returned from Access as True/False
> not Yes/No
>
>
> Hi All,
>
> I hope you can help with this one. I have an access 2000 db
> with yes/no
> fields. I query the db through asp and get my results back.
> e.g. Select *
> from table where ...
>
> However, when my results are displayed the yes/no fields from
> the access
> db now display as true/false. The field types within access are set
to
> yes/no. How can I set the data return to be yes/no.
>
> Any ideas would be really appreciated.
>
> Regards,
>
> Ken Dowling
>
>
>
> steve.carter@t...
> $subst('Email.Unsub')
>
Message #3 by "Ken Dowling" <ken.dowling@o...> on Thu, 13 Sep 2001 15:44:01
|
|
Thanks Everyone,
It is all working nicely now.
Regards to all
Ken
|
|
 |