VB icon

ADODBTypeName

Email
Submitted on: 1/6/2015 4:30:00 AM
By: Lewis E. Moten III (from psc cd)  
Level: Beginner
User Rating: By 2 Users
Compatibility: ASP (Active Server Pages)
Views: 1807
 
     Quickly find out the type of variables returned from your adodb recordset. TypeName() function doesn't do the trick. Databases offer additional data types. This script helps solve type problems without having to lookup the name of the numbers returned.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: ADODBTypeName
' Description:Quickly find out the type of variables returned from your adodb recordset. TypeName() function doesn't do the trick. Databases offer additional data types. This script helps solve type problems without having to lookup the name of the numbers returned.
' By: Lewis E. Moten III (from psc cd)
'**************************************

Response.write ADODBTypeName(Rs.Fields("UserID").Type)
Function ADODBTypeName(ByRef plngType)
	Select Case plngType
		Case 0:ADODBTypeName="adEmpty"
		Case 2:ADODBTypeName="adSmallInt"
		Case 3:ADODBTypeName="adInteger"
		Case 4:ADODBTypeName="adSingle"
		Case 5:ADODBTypeName="adDouble"
		Case 6:ADODBTypeName="adCurrency"
		Case 8:ADODBTypeName="adBSTR"
		Case 9:ADODBTypeName="adDispatch"
		Case 10:ADODBTypeName="adError"
		Case 11:ADODBTypeName="adBoolean"
		Case 12:ADODBTypeName="adVariant"
		Case 13:ADODBTypeName="adIUnknown"
		Case 14:ADODBTypeName="adDecimal"
		Case 16:ADODBTypeName="adTinyInt"
		Case 17:ADODBTypeName="adUnsignedTinyInt"
		Case 18:ADODBTypeName="adUnsignedSmallInt"
		Case 19:ADODBTypeName="adUnsignedInt"
		Case 21:ADODBTypeName="adUnsignedBigInt"
		Case 64:ADODBTypeName="adFileTime"
		Case 72:ADODBTypeName="adGUID"
		Case 20:ADODBTypeName="adBigInt"
		Case 128:ADODBTypeName="adBinary"
		Case 129:ADODBTypeName="adChar"
		Case 130:ADODBTypeName="adWChar"
		Case 131:ADODBTypeName="adNumeric"
		Case 132:ADODBTypeName="adUserDefined"
		Case 133:ADODBTypeName="adDBDate"
		Case 134:ADODBTypeName="adDBTime"
		Case 135:ADODBTypeName="adDBTimeStamp"
		Case 136:ADODBTypeName="adChapter"
		Case 137:ADODBTypeName="adDBFileTime"
		Case 138:ADODBTypeName="adPropVariant"
		Case 139:ADODBTypeName="adVarNumeric"
		Case 200:ADODBTypeName="adVarChar"
		Case 201:ADODBTypeName="adLongVarChar"
		Case 202:ADODBTypeName="adVarWChar"
		Case 203:ADODBTypeName="adLongVarWChar"
		Case 204:ADODBTypeName="adVarBinary"
		Case 205:ADODBTypeName="adLongVarBinary"
	End Select
End Function


Other 63 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.