Connecting Tech Pros Worldwide Forums | Help | Site Map

What do the field type numbers returned in the debug window mean?

MLH
Guest
 
Posts: n/a
#1: Nov 13 '05
I have this little snippet running whenever I want to list my table
field names in the debug window, along with their field types...
For i = 0 To TempRecordset.Fields.Count - 1
Debug.Print TempRecordset.Fields(i).Name; " ";
Debug.Print ", "; TempRecordset.Fields(i).Type
Next i

I don't understand the numbers returned for field type. Take
a look at the following sample output...

Fields in tblENF263SpecificInfo:
ENF263ID , 4
VehicleJobID , 4
LaborCost , 5
MatlsCost , 5
TowCost , 5
StorageCost , 5
OtherCost , 5
OtherDescr , 12
MatlsList , 12
SaleDate , 8
SaleHour , 10

What do these numbers mean?

Larry Linson
Guest
 
Posts: n/a
#2: Nov 13 '05

re: What do the field type numbers returned in the debug window mean?



"MLH" <CRCI@NorthState.net> wrote in message
news:qg1gf15sr0q1rontroj0i91bmjbihjhk6a@4ax.com...[color=blue]
>I have this little snippet running whenever I want to list my table
> field names in the debug window, along with their field types...
> For i = 0 To TempRecordset.Fields.Count - 1
> Debug.Print TempRecordset.Fields(i).Name; " ";
> Debug.Print ", "; TempRecordset.Fields(i).Type
> Next i
>
> I don't understand the numbers returned for field type. Take
> a look at the following sample output...
>
> Fields in tblENF263SpecificInfo:
> ENF263ID , 4
> VehicleJobID , 4
> LaborCost , 5
> MatlsCost , 5
> TowCost , 5
> StorageCost , 5
> OtherCost , 5
> OtherDescr , 12
> MatlsList , 12
> SaleDate , 8
> SaleHour , 10
>
> What do these numbers mean?[/color]


What are field type numbers?


pietlinden@hotmail.com
Guest
 
Posts: n/a
#3: Nov 13 '05

re: What do the field type numbers returned in the debug window mean?


dim tdf as dao.tabledef
dim fld as dao.field

set tdf=dbengine(0)(0).tabledefs(strTabledef)
for each fld in tdf.fields
debug.print fld.name, fld.type
next fld

the type field is numeric. Most handy if you want to create fields in
code...

Larry Linson
Guest
 
Posts: n/a
#4: Nov 13 '05

re: What do the field type numbers returned in the debug window mean?



<pietlinden@hotmail.com> wrote in message
news:1123556289.066918.283900@z14g2000cwz.googlegr oups.com...[color=blue]
> dim tdf as dao.tabledef
> dim fld as dao.field
>
> set tdf=dbengine(0)(0).tabledefs(strTabledef)
> for each fld in tdf.fields
> debug.print fld.name, fld.type
> next fld
>
> the type field is numeric. Most handy if you want to create fields in
> code...
>[/color]


Thanks! But I don't know VBA code--or whatever that is. I only use macros
(Access 97).



Larry Linson
Guest
 
Posts: n/a
#5: Nov 13 '05

re: What do the field type numbers returned in the debug window mean?


Nope, this one's from The Impersonator. Keep it up, wise guy, and we'll
sentence you to be Governor of California -- a fate worse than using macros.

"Larry Linson" <nospam@nospam.net> wrote in message
news:1123553620.2f57af0d4c32d7e586ab2ace6254785a@t eranews...[color=blue]
>
> "MLH" <CRCI@NorthState.net> wrote in message
> news:qg1gf15sr0q1rontroj0i91bmjbihjhk6a@4ax.com...[color=green]
>>I have this little snippet running whenever I want to list my table
>> field names in the debug window, along with their field types...
>> For i = 0 To TempRecordset.Fields.Count - 1
>> Debug.Print TempRecordset.Fields(i).Name; " ";
>> Debug.Print ", "; TempRecordset.Fields(i).Type
>> Next i
>>
>> I don't understand the numbers returned for field type. Take
>> a look at the following sample output...
>>
>> Fields in tblENF263SpecificInfo:
>> ENF263ID , 4
>> VehicleJobID , 4
>> LaborCost , 5
>> MatlsCost , 5
>> TowCost , 5
>> StorageCost , 5
>> OtherCost , 5
>> OtherDescr , 12
>> MatlsList , 12
>> SaleDate , 8
>> SaleHour , 10
>>
>> What do these numbers mean?[/color]
>
>
> What are field type numbers?
>[/color]


Larry Linson
Guest
 
Posts: n/a
#6: Nov 13 '05

re: What do the field type numbers returned in the debug window mean?


All right, Impersonator... off to Sacramento you go. Just tell the current
occupant of the Governator's mansion to get out of your way or you'll beat
up on him.

"Larry Linson" <nospam@nospam.net> wrote in message
news:1123557316.db206258e3e103247035be530125bb89@t eranews...[color=blue]
>
> <pietlinden@hotmail.com> wrote in message
> news:1123556289.066918.283900@z14g2000cwz.googlegr oups.com...[color=green]
>> dim tdf as dao.tabledef
>> dim fld as dao.field
>>
>> set tdf=dbengine(0)(0).tabledefs(strTabledef)
>> for each fld in tdf.fields
>> debug.print fld.name, fld.type
>> next fld
>>
>> the type field is numeric. Most handy if you want to create fields in
>> code...
>>[/color]
>
>
> Thanks! But I don't know VBA code--or whatever that is. I only use
> macros (Access 97).
>
>
>[/color]


David W. Fenton
Guest
 
Posts: n/a
#7: Nov 13 '05

re: What do the field type numbers returned in the debug window mean?


MLH <CRCI@NorthState.net> wrote in
news:qg1gf15sr0q1rontroj0i91bmjbihjhk6a@4ax.com:
[color=blue]
> I have this little snippet running whenever I want to list my
> table field names in the debug window, along with their field
> types...
> For i = 0 To TempRecordset.Fields.Count - 1
> Debug.Print TempRecordset.Fields(i).Name; " ";
> Debug.Print ", "; TempRecordset.Fields(i).Type
> Next i
>
> I don't understand the numbers returned for field type. Take
> a look at the following sample output...
>
> Fields in tblENF263SpecificInfo:
> ENF263ID , 4
> VehicleJobID , 4
> LaborCost , 5
> MatlsCost , 5
> TowCost , 5
> StorageCost , 5
> OtherCost , 5
> OtherDescr , 12
> MatlsList , 12
> SaleDate , 8
> SaleHour , 10
>
> What do these numbers mean?[/color]

Look up TYPE in A97 Help, and choose the DAO version. This takes you
to a listing of all the constants defined for this and an
explanation of which constant applies to which kind of Jet field.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Closed Thread


Similar Microsoft Access / VBA bytes