[AccessD] Getting Field Type From ADO Control

Stuart McLachlan stuart at lexacorp.com.pg
Thu Sep 11 06:08:54 CDT 2003


On 11 Sep 2003 at 12:40, paul.hartland at fsmail.net wrote:

> To all,
> I have a field selection box in a find form that I have created myself, but what I need to know is what datatype the field is that the user selects.
> Has anyone ever done this and can tell me how....I tried the following line of code which runs through all the fields but it returns a number......
> MsgBox frmPersonnel.ADOPersonnel.Recordset.Fields(fldCounter).Type
> Anyone have any ideas ?
> Thanks in advance for any help received.......
> Paul Hartland
> Database Designer/Programmer

Field types are enumerated constants.

In your VB project, set a reference to DAO then open the Object 
Browser.

Open the DAO library and look at Globals.

You will see things like:
dbBigInt = 16
dbBinary = 9
dbBooelan = 1
dbByte = 2
dbChar = 18
dbCurrency = 5
dbDate = 8
dbDecimal = 20
dbDouble = 7
dbFloat = 21
dbGUID = 15
dbInteger = 3
dbLong = 4
dbMemo = 12
dbNumeric = 19
dbSingle = 6
dbText = 10
dbTime = 22
dbTimestamp = 23


 
-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.





More information about the AccessD mailing list