I have an extremely long SQL statement that I need to run to update around 53
variables - and instead of having it run horizontally forever off my screen,
I would like to ask what is the proper way to carry statements over multiple
lines in VBScript instead of having to contain it on just one really really
really long line.

Is it possible?

Thanks for the assistance. I did a search on here and couldn't find anything.

Re: Very large SQL - how do I carry it over multiple lines by Gabriel

Gabriel
Wed Apr 06 13:23:42 CDT 2005

How about separate it with chr(13) + chr(10) ?

Its look like:

Enter=chr(13)+chr(10)

cSql="Select bla,bla,bla,bla," + Enter
cSql=cSql & "bla,bla,bla" + Enter
cSql=cSql & "from mytable" + Enter
SqlExecute(cSql)

That stuff works fine...

Gabriel.



"Chris" <Chris@discussions.microsoft.com> wrote in message
news:9DA10E67-7F28-4B32-9DF7-47569F2275A0@microsoft.com...
> I have an extremely long SQL statement that I need to run to update around
53
> variables - and instead of having it run horizontally forever off my
screen,
> I would like to ask what is the proper way to carry statements over
multiple
> lines in VBScript instead of having to contain it on just one really
really
> really long line.
>
> Is it possible?
>
> Thanks for the assistance. I did a search on here and couldn't find
anything.



Re: Very large SQL - how do I carry it over multiple lines by Chris

Chris
Wed Apr 06 13:53:03 CDT 2005

That could work, but I was looking for something more like what I've seen in
Java where

STATEMENT HERE IN THIS LINE OF CODE _ (where the "_" is a character that can
carry the statement down a line and not break the code/statement)
NEXT LINE - SAME STATEMENT CONTINUED

Does that make sense? Do I have that option in VBScript?

"Gabriel South" wrote:

> How about separate it with chr(13) + chr(10) ?
>
> Its look like:
>
> Enter=chr(13)+chr(10)
>
> cSql="Select bla,bla,bla,bla," + Enter
> cSql=cSql & "bla,bla,bla" + Enter
> cSql=cSql & "from mytable" + Enter
> SqlExecute(cSql)
>
> That stuff works fine...
>
> Gabriel.
>
>
>
> "Chris" <Chris@discussions.microsoft.com> wrote in message
> news:9DA10E67-7F28-4B32-9DF7-47569F2275A0@microsoft.com...
> > I have an extremely long SQL statement that I need to run to update around
> 53
> > variables - and instead of having it run horizontally forever off my
> screen,
> > I would like to ask what is the proper way to carry statements over
> multiple
> > lines in VBScript instead of having to contain it on just one really
> really
> > really long line.
> >
> > Is it possible?
> >
> > Thanks for the assistance. I did a search on here and couldn't find
> anything.
>
>
>

Re: Very large SQL - how do I carry it over multiple lines by Dave

Dave
Wed Apr 06 14:16:10 CDT 2005

Yes, do something like;
strSQL = "SELECT ComputerName, UserID, ProfileName, LastModDate " _
& "FROM Table3 " _
& "WHERE (((ComputerName)='mycomputer') AND ((UserID)='dabungis')); "

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Chris" wrote:
| That could work, but I was looking for something more like what I've seen
in
| Java where
|
| STATEMENT HERE IN THIS LINE OF CODE _ (where the "_" is a character that
can
| carry the statement down a line and not break the code/statement)
| NEXT LINE - SAME STATEMENT CONTINUED
|
| Does that make sense? Do I have that option in VBScript?



Re: Very large SQL - how do I carry it over multiple lines by Chris

Chris
Wed Apr 06 16:37:02 CDT 2005

That was what I needed, thanks.

Chris

"Dave Patrick" wrote:

> Yes, do something like;
> strSQL = "SELECT ComputerName, UserID, ProfileName, LastModDate " _
> & "FROM Table3 " _
> & "WHERE (((ComputerName)='mycomputer') AND ((UserID)='dabungis')); "
>
> --
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> "Chris" wrote:
> | That could work, but I was looking for something more like what I've seen
> in
> | Java where
> |
> | STATEMENT HERE IN THIS LINE OF CODE _ (where the "_" is a character that
> can
> | carry the statement down a line and not break the code/statement)
> | NEXT LINE - SAME STATEMENT CONTINUED
> |
> | Does that make sense? Do I have that option in VBScript?
>
>
>