[AccessD] Why Change Field Size/was Change Field Size

William Hindman wdhindman at bellsouth.net
Mon Dec 5 13:35:58 CST 2005


"that it's sloppy programming and suggests that you haven't
really thought out the design of the table." Charlotte

...lol ...how you do go on! ...if I'm absolutely certain of the field's 
content then I'll size it appropriately and validate the data ...and my 
table design tends toward a high degree of normalization so that I'm not 
overly concerned about record size, although it is a legitmate consideration 
...but, and this is where we may differ, if I have name, address, et al type 
fields where the data length is unknown, I prefer to default them to 255 
rather than establishing artificial limitations for the very reason that 
Rocky is running into ...if the guesstimate turns out to be wrong it can be 
a rpita to fix once in distribution.

...the only problem I've seen so far is the client using tabs within the 
field and I now routinely prevent that.

Willam

----- Original Message ----- 
From: "Charlotte Foust" <cfoust at infostatsystems.com>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Monday, December 05, 2005 11:32 AM
Subject: Re: [AccessD] Why Change Field Size/was Change Field Size


> I've had queries go belly up because every field was 255, but that was
> in 97.  This is one of those issues that has caused a great deal of
> "discussion" in the list, so you can check the archives to see the
> arguments pro and con.  If you design a field to hold a specific value
> size, then your controls will limit the value for you with less work by
> the programmer.  If you allow them to enter 255 characters into a field
> that is only supposed to contain a social security number, then you have
> to do extra programming to make sure that all you get is a social
> security number.  I suppose my objection to making them all maximum
> length is that it's sloppy programming and suggests that you haven't
> really thought out the design of the table.
>
> Charlotte Foust
>
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William
> Hindman
> Sent: Monday, December 05, 2005 8:18 AM
> To: Access Developers discussion and problem solving
> Subject: [AccessD] Why Change Field Size/was Change Field Size
>
>
> ....the original post raised a question for me
>
> ...my practice has been to default to 255 unless there was a specific
> need
> to define a smaller one, since with Jet, afaik, you pay no penalty for
> doing
> so ...and thus avoid having to do most future field size changes.
>
> ...is there any problem with this or am I missing something?
>
> William
>
> ----- Original Message ----- 
> From: "Martin" <mwp.reid at qub.ac.uk>
> To: <accessd at databaseadvisors.com>
> Sent: Monday, December 05, 2005 9:00 AM
> Subject: Re: [AccessD] Change Field Size
>
>
>> Rocky
>>
>> Dim strSql As String
>> strSql = "ALTER TABLE MyTable ALTER COLUMN MyField TEXT(33);"
>> DBEngine(0)(0).Execute strSql, dbFailOnError
>>
>>
>>
>>    From: "Rocky Smolin - Beach Access Software"<bchacc at san.rr.com>
>>    Sent: 05/12/05 13:43:38
>>    To: "Access Developers discussion and problem
>> solving"<accessd at databaseadvisors.com>
>>    Subject: Re: [AccessD] Change Field Size
>>
>>    Martin:
>>
>>    I can't find any references to Alter.  It's VBA, yes?
>>
>>    Rocky
>>
>>    ----- Original Message ----- 
>>    From: "Martin" <mwp.reid at qub.ac.uk>
>>    To: <accessd at databaseadvisors.com>
>>    Sent: Sunday, December 04, 2005 10:11 AM
>>    Subject: Re: [AccessD] Change Field Size
>>
>>
>>    > Rocky
>>    >
>>    > You may have to use an Alter statement  also note below from web.
>>    >
>>    >
>>    > Using DAO, you have to CreateField() of the new size, execute an
>> UPDATE
>>    > query to populate it, and then remove the old field.
>>    >
>>    > Martin
>>    >
>>    >
>>    > -----Original Message-----
>>    >    From: "Rocky Smolin - Beach Access
> Software"<bchacc at san.rr.com>
>>    >    Sent: 04/12/05 17:44:36
>>    >    To:
> "AccessD at databaseadvisors.com"<AccessD at databaseadvisors.com>
>>    >    Subject: [AccessD] Change Field Size
>>    >      Dear List:
>>    >
>>    >    Close, but no cigar.
>>    >
>>    >    I need to change the length of a field through code.  I've
> got:
>>    >
>>    >    Set wrk = DBEngine.Workspaces(0)
>>    >    Set db = wrk.OpenDatabase(gstrDatabaseName)
>>    >    Set tdf = db.TableDefs("tblPODetail")
>>    >
>>    >
>>    >        Set fld = tdf.Fields("fldPODPartDescription")
>>    >        fld.Properties("AllowZeroLength") = True
>>    >        fld.Properties("FieldSize") = 255
>>    >        tdf.Fields.Append fld
>>    >
>>    >    Set fld = Nothing
>>    >    Set tdf = Nothing
>>    >    Set db = Nothing
>>    >    Set wrk = Nothing
>>    >
>>    >    but fld.Properties("FieldSize") = 255  errors with "property
> can
>> only
>>    > be set when the Field is part of a Recordset object's field
>> collection.
>>    >
>>    >    What am I doing wrong?
>>    >
>>    >    MTIA,
>>    >
>>    >    Rocky Smolin
>>    >    Beach Access Software
>>    >    http://www.e-z-mrp.com
>>    >    858-259-4334
>>    >    -- 
>>    >    AccessD mailing list
>>    >    AccessD at databaseadvisors.com
>>    >    http://databaseadvisors.com/mailman/listinfo/accessd
>>    >    Website: http://www.databaseadvisors.com
>>    >
>>    >
>>    > -- 
>>    > AccessD mailing list
>>    > AccessD at databaseadvisors.com
>>    > http://databaseadvisors.com/mailman/listinfo/accessd
>>    > Website: http://www.databaseadvisors.com
>>    >
>>
>>    -- 
>>    AccessD mailing list
>>    AccessD at databaseadvisors.com
>>    http://databaseadvisors.com/mailman/listinf
>>
>> [Message truncated. Tap Edit->Mark for Download to get remaining
>> portion.]
>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
>>
>
>
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> -- 
> 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