By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,308 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

error #3259? A97

P: n/a
MLH
I get this error...
Invalid field data type
(3259)

When I run a line like this...
Set fld = tdf.CreateField("MyID", dbAutoIncrField)

dbAutoIncrField has an intrinsic value equal to 16.
Any reason why this should not work in Access 97?
Sep 1 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
If you open the object viewer (press F2 in the code window), and search on
dbAutoIncrField, you will discover it is a member of:
FieldAttributeEnum
not a member of:
DataTypeEnum

An Autonumber is a field of type Long Integer (dbLong), that has its
Attributes set to dbAutoIncrField plus whatever other attributes apply. A
Long is a fixed width field, so dbFixedField is the other attribute you
need.

So, you need something like this:
Set fld = tdf.CreateField("MyID", dbLong)
fld.Attributes = dbAutoIncrField + dbFixedField
tdf.Fields.Append fld

You might find this a useful reference:
Field type reference - names and values for DDL, DAO, and ADOX
at:
http://allenbrowne.com/ser-49.html
It compares the names in the interface with the names you use in DDL query
statements, DAO code, and ADOX code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.netwrote in message
news:pe********************************@4ax.com...
>I get this error...
Invalid field data type
(3259)

When I run a line like this...
Set fld = tdf.CreateField("MyID", dbAutoIncrField)

dbAutoIncrField has an intrinsic value equal to 16.
Any reason why this should not work in Access 97?


Sep 1 '06 #2

P: n/a
MLH
That was very helpful.
Thanks, Allen
Sep 1 '06 #3

P: n/a
MLH
Along that same line, I looked into
A97 HELP a bit and found these
Types all listed together in a section
that seems to imply they can be valid
values in the code line...

dbBigInt Big Integer
dbBinary Binary
dbBoolean Boolean
dbByte Byte
dbChar Char
dbCurrency Currency
dbDate Date/Time
dbDecimal Decimal
dbDouble Double
dbFloat Float
dbGUID GUID
dbInteger Integer
dbLong Long
dbLongBinary Long Binary (OLE Object)
dbMemo Memo
dbNumeric Numeric
dbSingle Single
dbText Text
dbTime Time
dbTimeStamp Time Stamp
dbVarBinary VarBinary

Most of my own needs can be satisfied with
dbBoolean, dbDate, dbInteger, dbLong and
dbText. Do you think most of the above mentioned
types will work without a hitch?
Sep 1 '06 #4

P: n/a
Most of those work with Access tables, but some work only with attached
tables from SQL Server or other databases.

Some of the names you see in the interface (like AutoNumber, and Hyperlink)
are not obvious from that list.

Some (like binary and fixed-width text) can be created with Access tables,
but not through the interface.

And there are other types in Access 2007 (such as dbAttachment and
dbComplexText.)

Ther reference list I personally use is:
http://allenbrowne.com/ser-49.html
and the footnotes tell you most of the extra aspects of the story.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.netwrote in message
news:3t********************************@4ax.com...
Along that same line, I looked into
A97 HELP a bit and found these
Types all listed together in a section
that seems to imply they can be valid
values in the code line...

dbBigInt Big Integer
dbBinary Binary
dbBoolean Boolean
dbByte Byte
dbChar Char
dbCurrency Currency
dbDate Date/Time
dbDecimal Decimal
dbDouble Double
dbFloat Float
dbGUID GUID
dbInteger Integer
dbLong Long
dbLongBinary Long Binary (OLE Object)
dbMemo Memo
dbNumeric Numeric
dbSingle Single
dbText Text
dbTime Time
dbTimeStamp Time Stamp
dbVarBinary VarBinary

Most of my own needs can be satisfied with
dbBoolean, dbDate, dbInteger, dbLong and
dbText. Do you think most of the above mentioned
types will work without a hitch?

Sep 2 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.