PDA

View Full Version : How can i put a CR/LF inside a string variable ?



NewsArchive
12-06-2001, 01:00 AM
Hi,

I have a SQL Script file (SqlScript.txt). This is Sql Server 7 script file
organise the way Entreprise Manager generate it.

I have a function in IS6.3 that piks the file, read it, fill a string
variable and then pass this string variable to the execute method of the ADO
connexion object. Doesn't work...

Because, my string do not hold CR/LF (all the line follow each other, even
without space), my execute method does not execute.

I tried to insert "\x0D0A" between my strings after reading a line with the
ListGetNextString function , but IS translate it in "\n". The result is bad
too.

How can i put a CR/LF inside a string variable ?
Or there is another way to make a sql file be executed on a sql server ?
Maybe with the DMO-Object... ?

Anyway, thanks in advance.
Mo

NewsArchive
12-10-2001, 01:00 AM
Don't you just write the string "\n", as a C++ CR/LF?

"Maurice" <furylibre@hotmail.com> wrote in message
news:3c104d59@news.installshield.com...
> Hi,
>
> I have a SQL Script file (SqlScript.txt). This is Sql Server 7 script
file
> organise the way Entreprise Manager generate it.
>
> I have a function in IS6.3 that piks the file, read it, fill a string
> variable and then pass this string variable to the execute method of the
ADO
> connexion object. Doesn't work...
>
> Because, my string do not hold CR/LF (all the line follow each other, even
> without space), my execute method does not execute.
>
> I tried to insert "\x0D0A" between my strings after reading a line with
the
> ListGetNextString function , but IS translate it in "\n". The result is
bad
> too.
>
> How can i put a CR/LF inside a string variable ?
> Or there is another way to make a sql file be executed on a sql server ?
> Maybe with the DMO-Object... ?
>
> Anyway, thanks in advance.
> Mo
>
>
>
>
>
>
>
>
>

NewsArchive
12-10-2001, 01:00 AM
Try "\r\n" instead...

"Maurice" <furylibre@hotmail.com> wrote in message
news:3c104d59@news.installshield.com...
> Hi,
>
> I have a SQL Script file (SqlScript.txt). This is Sql Server 7 script
file
> organise the way Entreprise Manager generate it.
>
> I have a function in IS6.3 that piks the file, read it, fill a string
> variable and then pass this string variable to the execute method of the
ADO
> connexion object. Doesn't work...
>
> Because, my string do not hold CR/LF (all the line follow each other, even
> without space), my execute method does not execute.
>
> I tried to insert "\x0D0A" between my strings after reading a line with
the
> ListGetNextString function , but IS translate it in "\n". The result is
bad
> too.
>
> How can i put a CR/LF inside a string variable ?
> Or there is another way to make a sql file be executed on a sql server ?
> Maybe with the DMO-Object... ?
>
> Anyway, thanks in advance.
> Mo
>
>
>
>
>
>
>
>
>