Re: SQL question

by Emerald Spirit <emerald_spirit(at)yahoo.com>

 Date:  Thu, 30 Aug 2001 10:23:49 -0700 (PDT)
 To:  hwg-techniques(at)hwg.org
 In-Reply-To:  D1C4FN01
  todo: View Thread, Original
YES!!!  Thank you!  I knew it had to be something
silly like that.  

To try to clarify with all those people I managed to
confuse...

The database I'm writing to has a field in
existence... basically a memo field with a column name
of Description.  The data in it looks like the
following:

__________________________________________

DATE:8/24/01 15:31:43    FROM:User
test

DATE:8/24/01 17:34:31    FROM:User
test again

___________________________________________

I have to essentially match the data that's in other
records when I create a new one so as to not mess up
other programs also using this same database.  In my
ASP code, I am writing out a SQL statement like the
following:

SQLInsert = "INSERT into MyTable (ID, Description)
VALUES (MYID, varDescription)

My problem was with my string varDescription.  I
didn't know how to enter the characters that would
create the same effect as a (shift+Enter) when typing
the data in the field by hand.

It turns out I had the right idea, just had the
characters in the wrong order.  I had it like the
following:

varDescription = "My little test string" & chr(10) &
chr(13) & "Rest of my little test string"

The field was showing up as:

____________________________________________-

My little test string<><>Rest of my little test string

_____________________________________________

The variable should have been:

varDescription = "My little test string" & chr(13) &
chr(10) & "Rest of my little test string"

In the database it would show up as:

___________________________________________

My little test string
Rest of my little test string
_______________________________________

Hopefully this makes more sense to people.

Thanks for all your help!!!

Rebecca


--- Frank Boumphrey <bckman(at)ix.netcom.com> wrote:
> .  I included a chr(10) and
> > chr(13) (line-feed and character returns)
> 
> This will indeed case two boxes!
> 
> It should be chr(13) followed by chr(10) :>)
> 
> ie
> 
> dim nl
>   nl=chr(13) & chr(10)
> 
> HTH
> Frank
> ----- Original Message -----
> From: "Emerald Spirit" <emerald_spirit(at)yahoo.com>
> To: <hwg-techniques(at)hwg.org>
> Sent: Wednesday, August 29, 2001 7:45 PM
> Subject: SQL question
> 
> 
> > Hi all!
> >
> > I've been banging my head up against the wall for
> the
> > better part of the day today over the following
> > problem:
> >
> > I need to do something that seems so simple.  I'm
> > running an insert SQL statement from an ASP page. 
> The
> > database is SQL Server 7.0.  This database has a
> text
> > field with a len of 16.  Another application
> running
> > off of this database and entering data into it.
> >
> > I need to match what its entering so that my
> system
> > won't upset the current system.  In this text
> field,
> > its entering what appears to be carriage returns
> into
> > the data, just as if you typed the data directly
> into
> > the field and pressed shift + enter to get a new
> line.
> >  I'm trying to create the SQL statement that will
> > write out a string into that field including those
> > character returns.
> >
> > I understand VB very well and have done versions
> of
> > this in Access database.  I included a chr(10) and
> > chr(13) (line-feed and character returns) in the
> SQL
> > statement.  Its writing the characters to the
> field in
> > the database, but they are not having the desired
> > effect.  Instead of showing as a new line, they
> are
> > just showing as two boxes.
> >
> > I know this is possible, and I know I've got to be
> > close.  Any suggestions???
> >
> > TIA
> >
> > Rebecca
> >
> > =====
> > Do while Project<>Completed
> >    if impossible = true then
> >       rethink(approach)
> >       set impossible = false
> >    end if
> > loop
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email alerts & NEW webcam video instant
> messaging with Yahoo!
> Messenger
> > http://im.yahoo.com
> 


=====
Do while Project<>Completed
   if impossible = true then
      rethink(approach)
      set impossible = false
   end if
loop

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA