Re: Updating SQL Text fields using ADO in ASP
- From: "tuuky" <tuuky@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 18 Jun 2005 21:59:01 -0700
Thank you, Andrew.
I'll give that a try first thing Monday.
Regards,
Rod
"Andrew D. Newbould" wrote:
> In message <4FDB8761-A857-4A8A-BCE8-03D6A9EF2802@xxxxxxxxxxxxx>, tuuky
> <tuuky@xxxxxxxxxxxxxxxxxxxxxxxxx> writes
> >I am trying to use a parameter list to insert and update a Text field
> >(datatype text) in a SQL table through a stored procedure.
> >
> >The asp form contains a text box that posts back to the page.
> >
> >.Parameter.Append .CreateParameter("@news_text", [text type here], newsText)
> >
> >First, I can't seem to find the constant value for such data type.
> >I tried using a adLongVarChar, but I received a conversion error.
> >
> >Any help would be appreciated.
>
> adLongVarChar is correct for an SQL Server TEXT field and adLongVarWChar
> for NTEXT fields.
>
> Your CreateParameter is however wrong. The syntax is:
>
> CreateParameter([Name], [Type], [Direction], [Size], [Value])
>
> If you do not wish to specify a particular parameter then you MUST still
> provide the Comma. In addition, ASP variables are typeless and therefore
> you are actually passing a Variant yet telling ADO (and therefore SQL)
> its a String. To be safe you really must get into the habit of casting
> your variables properly in ASP. Therefore you line should read:
>
> ..CreateParameter("@news_text", adLongVarChar, , , CStr(newsText))
>
> Kind Regards,
>
> --
> Andrew D. Newbould E-Mail: newsgroups@xxxxxxxxxxxxxxxxx
>
> ZAD Software Systems Web : www.zadsoft.com
>
.
- References:
- Updating SQL Text fields using ADO in ASP
- From: tuuky
- Re: Updating SQL Text fields using ADO in ASP
- From: Andrew D. Newbould
- Updating SQL Text fields using ADO in ASP
- Prev by Date: Can DLLs be compiled for both .NET 1.1 and .NET 2.0?
- Next by Date: thread problem
- Previous by thread: Re: Updating SQL Text fields using ADO in ASP
- Next by thread: newbie problem with compiling example for VC++ 2005
- Index(es):
Relevant Pages
|