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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Type Code Standard for a function

Status
Not open for further replies.

demoman

Programmer
Oct 24, 2001
242
US
Howdy!

I am constantly validiting data values in my code. Long ago, I wrote a function (below) which received the table, column, value and data type. It returns a boolean if the data does/does not exist. Works fine. However, I have never liked the fact I am passing the data type as a string ("int", "Date", etc). I am going to replace it with a type code (1 = "int", 2 = "date", etc.). Now, I could just make up my own, but I was wondering if there was a standard used in other functions, data definitions, etc. I seem to remember seeing this before, but cannot remember where. I know this is a trivial matter, but I am making a concerted effort to standardize my work.

Thanks


Public Function VerifyDataValue(strTable As String, strColumn As String, varValue As Variant, strType As String) As Boolean

 
See the ADO data types (DataTypeEnum) in help. Although they are more specific, i.e. smallint, longint, etc.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
You could just pass the ADO field object and get the field name, value, and data type all off the one object.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top