Re: concatenating a string that has quotes w/in, etc...
From: Kevin Spencer (kspencer_at_takempis.com)
Date: 09/03/04
- Next message: Kevin Spencer: "Re: Update SQL Blank Date Field?"
- Previous message: Jens Peter Karlsen[FP MVP]: "Re: Deleted webpage content"
- In reply to: mgm: "Re: concatenating a string that has quotes w/in, etc..."
- Next in thread: mgm: "Re: concatenating a string that has quotes w/in, etc..."
- Reply: mgm: "Re: concatenating a string that has quotes w/in, etc..."
- Messages sorted by: [ date ] [ thread ]
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
> >
> >
> >
- Next message: Kevin Spencer: "Re: Update SQL Blank Date Field?"
- Previous message: Jens Peter Karlsen[FP MVP]: "Re: Deleted webpage content"
- In reply to: mgm: "Re: concatenating a string that has quotes w/in, etc..."
- Next in thread: mgm: "Re: concatenating a string that has quotes w/in, etc..."
- Reply: mgm: "Re: concatenating a string that has quotes w/in, etc..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|