[AccessD] Puzzling error msg? <Invalid precision for decimal data type.>

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Wed Feb 19 03:52:00 CST 2003


Michael,

But you can't use VBA functions(even if they have VB6 equivalents) in
queries when you're working with VB6 - nor in query expression nor in all
the underlaying queries. Even string concatenation in a query expression is
treated as an operation, which needs VBAxxxxx.dll AFAIK... or I didn't get
what your problem is...

Shamil

----- Original Message -----
From: "Michael Maddison" <michael.maddison at ddisolutions.com.au>
To: <accessd at databaseadvisors.com>
Sent: Wednesday, February 19, 2003 6:49 AM
Subject: [AccessD] Puzzling error msg? <Invalid precision for decimal data
type.>


> Hi List,
>
> I've been beating my head against the wall for 24 hours now :-(
> I'm getting the following error in my VB 6 project and I don't know
> why...
>
> <Invalid precision for decimal data type.>
> <-2147467259>
>
> I'm attempting to execute an Update sql string using the ado connection
> object (I tried dao, it failed as well)
> The query joins 2 saved queries, which are themselves the product of
> table and query joins.  I cannot make major changes
> to the underlying queries/tables as I am basically porting an Access db
> to VB6.  (I didn't write any of the queries...
> it all works fine in Access!  When I copy and paste the query into
> access it runs with a problem)
>
> I've checked all the data types, joins, casts (even added a Val())!!!  I
> also cut
>
> I modified(below) the sql string to just open a recordset and it throws
> the same error!
>
> SELECT [queGetStands(1)].Period, [queGetStands(1)].CropType,
> [queGetStands(1)].Forest, [queGetStands(1)].Compartment,
> [queGetStands(1)].PatchNumber, [queGetStands(1)].Area,
> [queGetStands(1)].StartDate, [queGetStands(1)].AgeClass,
> [queGetStands(1)].Linkkey, [queGetStands(1)].SEASON,
> Val(CDbl(Fix([Pruned]*10+0.5*Sgn([Pruned]))/10)) AS Expr3,
> Val(CDbl(Fix([Large Sawlog]*10+0.5*Sgn([Large Sawlog]))/10)) AS Expr4,
> Val(CDbl(Fix([Medium Sawlog]*10+0.5*Sgn([Medium Sawlog]))/10)) AS Expr5,
>
> Val(CDbl(Fix([Small Sawlog]*10+0.5*Sgn([Small Sawlog]))/10)) AS Expr6,
> Val(CDbl(Fix([Pulp]*10+0.5*Sgn([Pulp]))/10)) AS Expr7,
>  [queGetStands(1)].YieldTable, 'C' AS Expr1, 0 AS Expr2
> FROM [queGetStands(1)] INNER JOIN [queFOLPIOS(1)] ON
> ([queGetStands(1)].AgeClass = [queFOLPIOS(1)].Age)
> AND ([queGetStands(1)].YieldTable = [queFOLPIOS(1)].OSYieldTable)
> WHERE ((([queGetStands(1)].Activity)='pulp'));
>
> Has anyone come across this type of thing before????
>
> Cheers
>
> Michael M
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list