Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

to learn field's data type

Status
Not open for further replies.

cihatkarli

Programmer
May 22, 2007
18
0
0
TR
i'm using ado to access. And my app will read a user created db. And will create custom textboxes for different data types.

for example, i will modify my text box for date entry if field is a DATETIME field.

Any help appreciated.
 
What about;
Code:
rst.Fields(3).Type
[green]'or[/green]
rst.Fields("MyFieldName").Type


Have fun.

---- Andy
 
uh sorry but returning values are not correct.

"202" value returns for both string and date :/
 
I try this:
Code:
recOne.Open "SELECT * From MyTable", Cn

For i = 0 To recOne.Fields.Count
    Debug.Print recOne.Fields(i).Type & " - " & recOne.Fields(i).Name
Next i

recOne.Close

And after some manipulation I could get something like;

200 - VARCHAR2
131 - NUMBER
129 - CHAR
135 - DATE

Are you sure that the Field that you keep the Date in is acctually formated as DATE, not just CHAR type that you just keep the date in?



Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top