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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Length 1

Status
Not open for further replies.

nicsin

Programmer
Jul 31, 2003
743
GB
Hi all,

is it possible to read the length of a field in access using sql (JET)?

Thanx,
Niko
 
Hi,

Code:
SELECT LEN([Field Name])
FROM [Your Table]
WHERE...

Hope this helps.

Cheers,
Leigh

You're only as good as your last backup!
 
thank you for the reply Leigh but probably I wasn't clear enough.

I am looking for the length of the field in the database. like what is the maximum number of characters a text field can have.
 
Ahh, sorry.

Cheers,
Leigh

You're only as good as your last backup!
 
Using SQL ... No.

Using JET DAO ... Yes

Code:
Currentdb.TableDefs("myTable").Fields("myField").Size
 
Yeah that's right! Well just came back to say that it's possible with ADO as well (i am using ADO) using the recordset's field's attribute DefinedSize (ActualSize is also available)

Great
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top