Ask a Question related to ASP Database, Design and Development.
-
Ken Lomax #1
Detecting the lenght of a MEMO field retrieved from a SQL database
Hi
using VBScript, SQL, ASP I would like to show the contents of a memo
field but only if it is not empty. I can do this with regular text
fields, but not a memo field. So something like:
sCommand = "SELECT aMemoField FROM aTable"
set sDetails=conn.execute(scommand)
if sDetails(0)<>"" then
%>..<%=sDetails(0)%><br>
<%end if%>
but this does not work with a memo field.
Can anyone please help??
Thanks
Ken
*** Sent via Devdex [url]http://www.devdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Ken Lomax Guest
-
Lenght of NText field
I have been using MSAccess databases when working with CF for the past 8 years. The following query or something very much like it has been hugly... -
SQL Where lenght of data in field GT 'n' characters
Need a sql where statement to pull only records where field 'ABC' contains more than 2 characters (nvarchar 255 field) -
Exception error querying Access database from ASP page... Memo field type?
Hi! Working with an MS Access database from an ASP webpage and I'm getting an Exception error... Error Type: (0x80020009) Exception... -
How to get the lenght of an Access database using ADOX
I want to administer a remote Access database using ASP. I use the ADOX setup. I am able to list the tables, the fields in each table, the field... -
Detecting MEMO field
Hi all, i'd like to know if there is some way to detect whether a field is of type MEMO (i'm using MS Access) so to behave accordingly placing a... -
Bob Barrows [MVP] #2
Re: Detecting the lenght of a MEMO field retrieved from a SQL database
Ken Lomax wrote:
What does "does not work" mean? Error message? Incorrect result?> Hi
>
> using VBScript, SQL, ASP I would like to show the contents of a memo
> field but only if it is not empty. I can do this with regular text
> fields, but not a memo field. So something like:
>
> sCommand = "SELECT aMemoField FROM aTable"
> set sDetails=conn.execute(scommand)
> if sDetails(0)<>"" then
> %>..<%=sDetails(0)%><br>
> <%end if%>
>
> but this does not work with a memo field.
I normally use the len() function with all strings instead of comparing to
"". Your logic is missing a step however: you should test for EOF before
attempting to read the contents of a Field (why not use the more
straightforward "rs" for your recordset variable?):
if not sDetails.EOF then
if len(sDetails(0)) > 0 then
...
end if
end if
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows [MVP] Guest
-
Aaron [SQL Server MVP] #3
Re: Detecting the lenght of a MEMO field retrieved from a SQL database
Is it MEMO in Access, or TEXT in SQL Server? SQL Server doesn't have a MEMO
datatype.
What does "does not work" mean?
Have you read:
[url]http://www.aspfaq.com/2188[/url]
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
"Ken Lomax" <kennethlomax@hotmail.com> wrote in message
news:#bFOOrTTEHA.2544@TK2MSFTNGP10.phx.gbl...> Hi
>
> using VBScript, SQL, ASP I would like to show the contents of a memo
> field but only if it is not empty. I can do this with regular text
> fields, but not a memo field. So something like:
>
> sCommand = "SELECT aMemoField FROM aTable"
> set sDetails=conn.execute(scommand)
> if sDetails(0)<>"" then
> %>..<%=sDetails(0)%><br>
> <%end if%>
>
> but this does not work with a memo field.
> Can anyone please help??
> Thanks
> Ken
>
>
> *** Sent via Devdex [url]http://www.devdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Aaron [SQL Server MVP] Guest



Reply With Quote

