473,385 Members | 1,798 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,385 software developers and data experts.

VB Indexes For Data Types?

Greetings,

I'm still using MS Access 2K3 and DAO 3.6 objects (I know, I know, I'm a
dinosaur)...

I'm traversing through the fields of a table to retrieve their data
types, thus,

Dim columntype as variant
Set db = CurrentDb()
Set tdf = db.TableDefs("MyTable")
columncount = tdf.Fields.Count
For i = 0 To columncount
columntype = tdf.Fields(i).Type
Next i

What's happening is that "columntype = tdf.Fields(i).Type" is returning
an integer, i.e, for a field of type "Text", it returns a "10", for a
field of type "Number|Integer", it returns a "7", etc.

Evidently these various data types have associated VB indexes. But I
can't for the life of me find a page anywhere in Help or on the web that
maps these VB integer values to their associated field data types. Help,
anyone? I know, it's probably right under my nose somewhere...
Nov 28 '07 #1
4 1999
On Tue, 27 Nov 2007 16:57:11 -0800, Fester Bestertester
<wh*********@mad.netwrote:

Code window F2 to open the object browser select DAO library and
look around. The DataTypeEnum sounds promising.

-Tom.

>Greetings,

I'm still using MS Access 2K3 and DAO 3.6 objects (I know, I know, I'm a
dinosaur)...

I'm traversing through the fields of a table to retrieve their data
types, thus,

Dim columntype as variant
Set db = CurrentDb()
Set tdf = db.TableDefs("MyTable")
columncount = tdf.Fields.Count
For i = 0 To columncount
columntype = tdf.Fields(i).Type
Next i

What's happening is that "columntype = tdf.Fields(i).Type" is returning
an integer, i.e, for a field of type "Text", it returns a "10", for a
field of type "Number|Integer", it returns a "7", etc.

Evidently these various data types have associated VB indexes. But I
can't for the life of me find a page anywhere in Help or on the web that
maps these VB integer values to their associated field data types. Help,
anyone? I know, it's probably right under my nose somewhere...
Nov 28 '07 #2
"Fester Bestertester" <wh*********@mad.netwrote in message
news:fi**********@gondor.sdsu.edu...
Greetings,

I'm still using MS Access 2K3 and DAO 3.6 objects (I know, I know, I'm a
dinosaur)...

I'm traversing through the fields of a table to retrieve their data types,
thus,

Dim columntype as variant
Set db = CurrentDb()
Set tdf = db.TableDefs("MyTable")
columncount = tdf.Fields.Count
For i = 0 To columncount
columntype = tdf.Fields(i).Type
Next i

What's happening is that "columntype = tdf.Fields(i).Type" is returning an
integer, i.e, for a field of type "Text", it returns a "10", for a field
of type "Number|Integer", it returns a "7", etc.

Evidently these various data types have associated VB indexes. But I can't
for the life of me find a page anywhere in Help or on the web that maps
these VB integer values to their associated field data types. Help,
anyone? I know, it's probably right under my nose somewhere...
Search help for VarType Constants.
Nov 28 '07 #3
Tom and Stuart have explained how to get these values for yourself.

Here's a bit of code you can use to return the file type names:
http://allenbrowne.com/func-06.html

--
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.

"Fester Bestertester" <wh*********@mad.netwrote in message
news:fi**********@gondor.sdsu.edu...
Greetings,

I'm still using MS Access 2K3 and DAO 3.6 objects (I know, I know, I'm a
dinosaur)...

I'm traversing through the fields of a table to retrieve their data
types, thus,

Dim columntype as variant
Set db = CurrentDb()
Set tdf = db.TableDefs("MyTable")
columncount = tdf.Fields.Count
For i = 0 To columncount
columntype = tdf.Fields(i).Type
Next i

What's happening is that "columntype = tdf.Fields(i).Type" is returning
an integer, i.e, for a field of type "Text", it returns a "10", for a
field of type "Number|Integer", it returns a "7", etc.

Evidently these various data types have associated VB indexes. But I
can't for the life of me find a page anywhere in Help or on the web that
maps these VB integer values to their associated field data types. Help,
anyone? I know, it's probably right under my nose somewhere...
Nov 28 '07 #4
Allen Browne wrote:
Tom and Stuart have explained how to get these values for yourself.

Here's a bit of code you can use to return the file type names:
http://allenbrowne.com/func-06.html
Cool. Many thanks for all the responses.
Nov 28 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David Brown | last post by:
With MySQL is it possible to have indexes or tables held in RAM? If so how do I ensure that updates are copied to disk? Regards, Dave.
2
by: Chris | last post by:
Any help would be appreciated. I am running a script that does the following in succession. 1-Drop existing database and create new database 2-Defines tables, stored procedures and functions...
3
by: Randell D. | last post by:
Folks, My internet access is intermitent until I get my own connection inside the next ten days - I say this so that I can thank in advance who ever gives a few seconds to read/answer my...
1
by: val | last post by:
In the 7.3 documentation about character data types (http://www.postgresql.org/docs/7.3/static/datatype- character.html), it states: "Tip: There are no performance differences between these* three...
4
by: Thomas F.O'Connell | last post by:
Since the current stable version of postgres (7.4.x) doesn't allow cross-datatype comparisons of indexes, is it always necessary to cast my application data explicitly in order for an index to be...
5
by: Shiraz | last post by:
Is there some manual on how to make indexes? for example: table is create mytable ( a varchar, b varchar, c int, d int
14
by: Jeff | last post by:
This is the first time that I remember ever having too many indexes on a table, but it has happened. I have en employees table and store in many places, on tables, the id of the employee that...
1
by: Curt | last post by:
What is the difference please?
2
by: umair.cheema | last post by:
Hi! 1-I read in MS Access help that Indexes are automatically made when we declare a primary key and they are used for fast searching and sorting purpose. But i am still confused that how can i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.