473,379 Members | 1,270 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

error #3259? A97

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
4 4458
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
MLH
That was very helpful.
Thanks, Allen
Sep 1 '06 #3
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
2
by: BSL | last post by:
> I'm new to asp.net. Started following a book, I created a FirstApplicatio and when i try to run it on the browser it gives me the following server parse erro ------------ Could not load type...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
0
by: manauwaralam | last post by:
javax.naming.NameNotFoundException: While trying to lookup 'weblogic.jdbc.jts.vdmsPool' didn't find subcontext 'jdbc' Resolved weblogic; remaining name 'jdbc/jts/vdmsPool' at...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
5
by: yashu0209 | last post by:
I have an error occurring when i try to compile the program and the error is: D:\Program Files\visual studio 6.0\MSDev98\MyProjects\GLEnabledView\GLNew.cpp(164) : error C2653: 'CGLEnabledView' :...
2
by: randa zaghdan | last post by:
Hi I have a problem with my program in vc 2008 When I compile it, the following errors are listed. I try to resolve it but no hope Does any one can help me ? thanks . Linking......
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.