[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Invalid Precision Error Writing Moderately Long Memo

Jack Straub

5/8/2002 11:23:00 PM

Hi -

I am trying to update a memo field using the ODBC .net
libraries in Visual C++. My OdbcParameter type is
OdbcType::Char (I have also tried VarChar), and the size
and precision default. Everything is fine as long as I
keep my parameter value between 0 and 255 characters; as
soon as I exceed 255 characters,
OdbcCommand::ExecuteNonQuery throws an exception,
insisting that I am using an invalid precision value
(ERROR [HY104] [Microsoft][ODBC Microsoft Access Driver]
Invalid precision value). I have tried playing with
OdbcParameter::Precision, but I don't even know what this
property means in the context of a string.

Can you tell me what I am doing wrong?

Thanks.
2 Answers

Bob Beauchemin

5/9/2002 2:35:00 AM

0

Have you tried OdbcType::Text?

Bob Beauchemin
bobb@develop.com


"Jack Straub" <j.w.straub@att.net> wrote in message
news:16c001c1f6d6$954b2a50$9ee62ecf@tkmsftngxa05...
> Hi -
>
> I am trying to update a memo field using the ODBC .net
> libraries in Visual C++. My OdbcParameter type is
> OdbcType::Char (I have also tried VarChar), and the size
> and precision default. Everything is fine as long as I
> keep my parameter value between 0 and 255 characters; as
> soon as I exceed 255 characters,
> OdbcCommand::ExecuteNonQuery throws an exception,
> insisting that I am using an invalid precision value
> (ERROR [HY104] [Microsoft][ODBC Microsoft Access Driver]
> Invalid precision value). I have tried playing with
> OdbcParameter::Precision, but I don't even know what this
> property means in the context of a string.
>
> Can you tell me what I am doing wrong?
>
> Thanks.


Bob Beauchemin

5/9/2002 7:15:00 PM

0

Hi Jack,

I don't think its an SQL (language) thing....its a data type mapping thing.
I looked in the mappings of ODBC types to database types.OdbcType::Char and
VarChar map to SQL (database) CHAR and VARCHAR, which, in some databases,
has a limit of 255. OdbcType::Text maps to LONGVARCHAR which AFAIK, is an
Access memo field.

Cheers,
Bob Beauchemin
bobb@develop.com


"Jack Straub" <j.w.straub@att.net> wrote in message
news:1d7e01c1f773$37c4f940$9be62ecf@tkmsftngxa03...
> Thank you, that did. But why? Or is the answer that it's
> past time I bought a book on SQL?
>
>
> >-----Original Message-----
> >Have you tried OdbcType::Text?
> >
> >Bob Beauchemin
> >bobb@develop.com
> >
> >
> >"Jack Straub" <j.w.straub@att.net> wrote in message
> >news:16c001c1f6d6$954b2a50$9ee62ecf@tkmsftngxa05...
> >> Hi -
> >>
> >> I am trying to update a memo field using the ODBC .net
> >> libraries in Visual C++. My OdbcParameter type is
> >> OdbcType::Char (I have also tried VarChar), and the
> size
> >> and precision default. Everything is fine as long as I
> >> keep my parameter value between 0 and 255 characters;
> as
> >> soon as I exceed 255 characters,
> >> OdbcCommand::ExecuteNonQuery throws an exception,
> >> insisting that I am using an invalid precision value
> >> (ERROR [HY104] [Microsoft][ODBC Microsoft Access
> Driver]
> >> Invalid precision value). I have tried playing with
> >> OdbcParameter::Precision, but I don't even know what
> this
> >> property means in the context of a string.
> >>
> >> Can you tell me what I am doing wrong?
> >>
> >> Thanks.
> >
> >
> >.
> >