Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TableDef and Fielddef propertys 2

Status
Not open for further replies.

jbrowne

Programmer
Feb 1, 2000
182
IE
Hello everyone!
I want to know is there any tabledef property or fielddef property that can pick up the decimal position of a numeric field in a database? if there isn't is there any other way of interigating the database through vb to get this property? Also the same goes for uppercase in regards to a character field!?
Thanks
 
You can get the fixed decimal place of a fieldusing FieldDef.
You can get the actual no. of decimals places a field in a record using a recordset.

What do you want?
 
Its the actual decimal position im looking for so its the fixed decimal place im looking for!
 
??
What I mean, is that one can set a fixed number of decimal places a field should have - and this will be reflected by all records.
Or, if not, then for each record the value of the field gets save with the actual no. of decimal places - so one record may show 2 decimal places and the other may show 5 - for the same field.

The second should be clear - set up a recordset, query the table, move to the record in question, reference the field in question, and then using InStr return the position of the decimal and then subtract this from the Len of the field value.

For the first, use a recordset and just query the property in question:
Debug.Print rs.Fields("myField").Properties("decimalplaces")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top