Dynamic Counter in a Table or a Query to Count Records (Q199679) 
Author Message
 Dynamic Counter in a Table or a Query to Count Records (Q199679)

ACC2000: How to Simulate a Dynamic Counter in a Table or a
Query to Count Records (Q199679):

 When I execute I receive the error message:

"3259 Invalid field data type".

Can any one explain? Yes I have Microsoft DAO 3.6 Object
Library checked.

.



Sun, 19 Sep 2004 23:44:56 GMT  
 Dynamic Counter in a Table or a Query to Count Records (Q199679)
Huh!  Have gone into Debug mode and checked which field is giving this
error?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(to reply via e-mail, remove NOSPAM from address)


Quote:
> ACC2000: How to Simulate a Dynamic Counter in a Table or a
> Query to Count Records (Q199679):

>  When I execute I receive the error message:

> "3259 Invalid field data type".

> Can any one explain? Yes I have Microsoft DAO 3.6 Object
> Library checked.

> .



Mon, 20 Sep 2004 00:53:21 GMT  
 Dynamic Counter in a Table or a Query to Count Records (Q199679)
Here are the results from debug.  
?myfld.Name CNTY
?myfld.Type 20
?myfld.Size 16
We opened the table.  The CNTY variable in question has a
format of:
 DataType=Number, Field Size=Decimal, Precision=2,
Scale=0, Decimal Places=Auto, Required=Yes and Indexed=no.

We do question these formats(since I created  them in
ODBC :-( ).  Can we revise the module code to be more
forgiveing?

From DB2 we could not get these to format as Long
Integer.?  Can u comment on this?  

Quote:
>-----Original Message-----
>Huh!  Have gone into Debug mode and checked which field
is giving this
>error?

>--
>Dirk Goldgar, MS Access MVP
>www.datagnostics.com

>(to reply via e-mail, remove NOSPAM from address)



>> ACC2000: How to Simulate a Dynamic Counter in a Table
or a
>> Query to Count Records (Q199679):

>>  When I execute I receive the error message:

>> "3259 Invalid field data type".

>> Can any one explain? Yes I have Microsoft DAO 3.6 Object
>> Library checked.

>> .

>.



Tue, 21 Sep 2004 22:22:42 GMT  
 Dynamic Counter in a Table or a Query to Count Records (Q199679)
I'm pretty sure DAO 3.6 doesn't fully support Decimal fields.  You can read
them and update them, it would appear, but not create them.  I believe you
could adapt the code to use ADOX and make it work that way.  Or you could
change the code to check for a decimal field and convert it to a Long, or
Single, or Double field in the output table, depending on what size values
you expect to process.

Is the input table a local table, imported from DB2, or is it linked to the
actual DB2 table?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(to reply via e-mail, remove NOSPAM from address)


Quote:
> Here are the results from debug.
> ?myfld.Name CNTY
> ?myfld.Type 20
> ?myfld.Size 16
> We opened the table.  The CNTY variable in question has a
> format of:
>  DataType=Number, Field Size=Decimal, Precision=2,
> Scale=0, Decimal Places=Auto, Required=Yes and Indexed=no.

> We do question these formats(since I created  them in
> ODBC :-( ).  Can we revise the module code to be more
> forgiveing?

> From DB2 we could not get these to format as Long
> Integer.?  Can u comment on this?

> >-----Original Message-----
> >Huh!  Have gone into Debug mode and checked which field
> is giving this
> >error?

> >--
> >Dirk Goldgar, MS Access MVP
> >www.datagnostics.com

> >(to reply via e-mail, remove NOSPAM from address)



> >> ACC2000: How to Simulate a Dynamic Counter in a Table
> or a
> >> Query to Count Records (Q199679):

> >>  When I execute I receive the error message:

> >> "3259 Invalid field data type".

> >> Can any one explain? Yes I have Microsoft DAO 3.6 Object
> >> Library checked.

> >> .

> >.



Wed, 22 Sep 2004 04:44:29 GMT  
 Dynamic Counter in a Table or a Query to Count Records (Q199679)
Thanks
 Could You post sample code to check and convert decimal
data?
 Also, the data is read from the Actual DB2 tables.  We
are in the processs of changing the format to long(?)
instead of decimal.
  When we originally created the DB2 tables, DB2 would not
accept INTEGER, are you familiar with this problem?

Quote:
>-----Original Message-----
>I'm pretty sure DAO 3.6 doesn't fully support Decimal

fields.  You can read
Quote:
>them and update them, it would appear, but not create

them.  I believe you
Quote:
>could adapt the code to use ADOX and make it work that
way.  Or you could
>change the code to check for a decimal field and convert
it to a Long, or
>Single, or Double field in the output table, depending on
what size values
>you expect to process.

>Is the input table a local table, imported from DB2, or
is it linked to the
>actual DB2 table?

>--
>Dirk Goldgar, MS Access MVP
>www.datagnostics.com

>(to reply via e-mail, remove NOSPAM from address)



>> Here are the results from debug.
>> ?myfld.Name CNTY
>> ?myfld.Type 20
>> ?myfld.Size 16
>> We opened the table.  The CNTY variable in question has
a
>> format of:
>>  DataType=Number, Field Size=Decimal, Precision=2,
>> Scale=0, Decimal Places=Auto, Required=Yes and
Indexed=no.

>> We do question these formats(since I created  them in
>> ODBC :-( ).  Can we revise the module code to be more
>> forgiveing?

>> From DB2 we could not get these to format as Long
>> Integer.?  Can u comment on this?

>> >-----Original Message-----
>> >Huh!  Have gone into Debug mode and checked which field
>> is giving this
>> >error?

>> >--
>> >Dirk Goldgar, MS Access MVP
>> >www.datagnostics.com

>> >(to reply via e-mail, remove NOSPAM from address)



>> >> ACC2000: How to Simulate a Dynamic Counter in a Table
>> or a
>> >> Query to Count Records (Q199679):

>> >>  When I execute I receive the error message:

>> >> "3259 Invalid field data type".

>> >> Can any one explain? Yes I have Microsoft DAO 3.6
Object
>> >> Library checked.

>> >> .

>> >.

>.



Fri, 24 Sep 2004 22:09:01 GMT  
 Dynamic Counter in a Table or a Query to Count Records (Q199679)

Quote:
> Thanks
>  Could You post sample code to check and convert decimal
> data?
>  Also, the data is read from the Actual DB2 tables.  We
> are in the processs of changing the format to long(?)
> instead of decimal.
>   When we originally created the DB2 tables, DB2 would not
> accept INTEGER, are you familiar with this problem?

No, I'm not familiar with DB2.  When I was checking this out, I created a
modified version of the CreateCountTbl function to substitute a Long field
in the output table for a Decimal field in the input table.  The only change
I made was here:

        For Each myfld In MyRs.Fields
            With NewTd
'*** original version below ***
'                .Fields.Append .CreateField(myfld.Name, _
'                    myfld.Type, myfld.Size)
'*** original version above ***
'*** modified version below ***
                If myfld.Type = dbDecimal Then
                    .Fields.Append .CreateField(myfld.Name, _
                        dbLong, 4)
                Else
                    .Fields.Append .CreateField(myfld.Name, _
                        myfld.Type, myfld.Size)
                End If
'*** modified version above ***
            End With
        Next myfld

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(to reply via e-mail, remove NOSPAM from address)



Sat, 25 Sep 2004 00:37:28 GMT  
 Dynamic Counter in a Table or a Query to Count Records (Q199679)
Yes, THANKS!  It's working OK now.

Quote:
>-----Original Message-----


>> Thanks
>>  Could You post sample code to check and convert decimal
>> data?
>>  Also, the data is read from the Actual DB2 tables.  We
>> are in the processs of changing the format to long(?)
>> instead of decimal.
>>   When we originally created the DB2 tables, DB2 would
not
>> accept INTEGER, are you familiar with this problem?

>No, I'm not familiar with DB2.  When I was checking this
out, I created a
>modified version of the CreateCountTbl function to

substitute a Long field
Quote:
>in the output table for a Decimal field in the input

table.  The only change

- Show quoted text -

Quote:
>I made was here:

>        For Each myfld In MyRs.Fields
>            With NewTd
>'*** original version below ***
>'                .Fields.Append .CreateField(myfld.Name, _
>'                    myfld.Type, myfld.Size)
>'*** original version above ***
>'*** modified version below ***
>                If myfld.Type = dbDecimal Then
>                    .Fields.Append .CreateField
(myfld.Name, _
>                        dbLong, 4)
>                Else
>                    .Fields.Append .CreateField
(myfld.Name, _
>                        myfld.Type, myfld.Size)
>                End If
>'*** modified version above ***
>            End With
>        Next myfld

>--
>Dirk Goldgar, MS Access MVP
>www.datagnostics.com

>(to reply via e-mail, remove NOSPAM from address)

>.



Sun, 26 Sep 2004 21:47:51 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. How to Simulate a Dynamic Counter in a Table or a Query to Count Records

2. Eliminate records of one table based on another table record count

3. Creating form query counting records in table?

4. counting records using a dynamic cursor?

5. Query record count

6. Counting Records in a Query

7. Count record in Query

8. Count records in Query

9. Counting records returned in a query

10. How to count records in a query?

11. Counting Records Returned from a Query

12. Counting Records Returned from a Query

 

 
Powered by phpBB® Forum Software