Re: concatenating a string that has quotes w/in, etc...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Kevin Spencer (kspencer_at_takempis.com)
Date: 09/03/04


Date: Fri, 3 Sep 2004 16:18:58 -0400

I've not seen the syntax you used, without the parentheses. You might the
following instead:

oConn.Execute(Session("aUpdateRows")(nCtr))

Wish I could be more definite, but my ASP and VBScript are starting to get a
little rusty!

-- 
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"mgm" <mgm@discussions.microsoft.com> wrote in message
news:5F416685-04E1-4610-B9ED-C0B12888D450@microsoft.com...
> New question below:
>
> I figured it out, actually the name of the text box was longer:
>     "Request.Form("Number" &  Cstr(nCtr)"
> I just had added an extra parentheses after "Number" that didn't need to
be
> there.
>
> The text boxes I have are built in a loop,
> I named them using a counter variable so I can differentiate
> between different rows of the same fields, such as:
>
> Key0 - Number0 - Category0 - Comments0
> Key1 - Number1 - Category1 - Comments1
> Key2 - Number2 - Category2 - Comments2
>
> the text box is named like this:
> <input name="Number<%=nCtr%>" ...>
>
> It's the only way i could think to do it.
>
> Anyway, another question :)  -- 
> I got the update queries built now and in an array.
>
> Now trying to execute the command I'm getting an error:
>   "Command text was not set for the command object. "
>
> This is how I have it written:
> If Session("bUpdate") Then
>   Set oConn = Server.CreateObject("ADODB.Connection")
>   oConn.Open Application("ConStr")
>   For nCtr = 0 to UBound(Session("aUpdateRows"),1)
>     oConn.Execute Session("aUpdateRows")(nCtr)  'is this not written
right?
>   Next
>   oConn.Close
> End If
>
> Do you know why I get that error?
>
> Thanks Kevin..
> Geniene
>
>
> "Kevin Spencer" wrote:
>
> > Apparently, Request.Form("Number") has no value.
> >
> > -- 
> > HTH,
> > Kevin Spencer
> > ..Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "mgm" <mgm@discussions.microsoft.com> wrote in message
> > news:21158011-9FAB-43EF-89D3-84E6825A3855@microsoft.com...
> > > I'm building a string variable w/in a loop, I need to add this to it:
> > > (Request.Form("Number") & Cstr(nCtr))
> > > If i response.write the above, I get what i want, but if i add the
> > > above to a string I am building, ie:
> > > sUpdateSql= sUpdateSql & " Number = '" & (Request.Form("Number") &
> > > Cstr(nCtr)) & "'"
> > > It only adds 'Number = '0'  (0 being what is in nCtr) to the string.
> > >
> > > This question is part of another i posted that I am still struggling
with.
> > > The subject is "Subject: Update method - multiple updates in 1
execution?"
> > >
> > > The whole thing I'm trying to do is:
> > > User can make changes to existing data in a form.
> > > The form posts to another page for one last view before committing
> > > new data to database.
> > > On that page I am building the command text in one big string that
will
> > > later be parsed and used (somehow) to make multiple updates.
> > >
> > > Any help would be greatly appreciated.  Thanks.
> > > Geniene
> >
> >
> >


Relevant Pages

  • Re: Fathers PhD Thesis
    ... Theory of Elasticity at the National Technical University of Athens. ... Elasticity using Complex Variables. ... TeX interprets the space after it as a statement saying that the command ... I have already defined macros for parentheses as ...
    (sci.math)
  • setting an alias in .cshrc with parentheses in it ...
    ... I often run this command: ... includes parentheses. ... So, to save time, I added this line to my .cshrc: ... MSIE blah blah)" ...
    (freebsd-questions)
  • Re: Dr. Evil typed sleep 666; rm -rf /
    ... didn't see I hadn't fixed the posting settings yet! ... anyway, the .invalid will soon be invalid to use too, when ... Compound commands and command sequences of the form `a; b; c' are not handled gracefully when process sus- ... It suffices to place the sequence of commands between parentheses to force it into a subshell, ...
    (comp.unix.shell)
  • Re: Question on building Web application
    ... Kevin Spencer ... which does not have IIS running. ... >> devenv /build command? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: gcc with Debian on amd64
    ... > int main ... The parentheses here are superfluous. ... The return word in C is a command, ... Hope this helps, Rogério Brito. ...
    (Debian-User)