資料來源:http://support.microsoft.com/kb/193947
* DEFINEs for field types - provided for reference only.
#DEFINE ADEMPTY 0
#DEFINE ADTINYINT 16
#DEFINE ADSMALLINT 2
#DEFINE ADINTEGER 3
#DEFINE ADBIGINT 20
#DEFINE ADUNSIGNEDTINYINT 17
#DEFINE ADUNSIGNEDSMALLINT 18
#DEFINE ADUNSIGNEDINT 19
#DEFINE ADUNSIGNEDBIGINT 21
#DEFINE ADSINGLE 4
#DEFINE ADDOUBLE 5
#DEFINE ADCURRENCY 6
#DEFINE ADDECIMAL 14
#DEFINE ADNUMERIC 131
#DEFINE ADBOOLEAN 11
#DEFINE ADERROR 10
#DEFINE ADUSERDEFINED 132
#DEFINE ADVARIANT 12
#DEFINE ADIDISPATCH 9
#DEFINE ADIUNKNOWN 13
#DEFINE ADGUID 72
#DEFINE ADDATE 7
#DEFINE ADDBDATE 133
#DEFINE ADDBTIME 134
#DEFINE ADDBTIMESTAMP 135
#DEFINE ADBSTR 8
#DEFINE ADCHAR 129
#DEFINE ADVARCHAR 200
#DEFINE ADLONGVARCHAR 201
#DEFINE ADWCHAR 130
#DEFINE ADVARWCHAR 202
#DEFINE ADLONGVARWCHAR 203
#DEFINE ADBINARY 128
#DEFINE ADVARBINARY 204
#DEFINE ADLONGVARBINARY 205
#DEFINE ADCHAPTER 136
oRecordSet = CREATEOBJECT("ADODB.Recordset")
lcSQL = "select * from authors"
oRecordSet.OPEN(lcSQL, ;
"DRIVER={SQL Server};" + ;
"SERVER=YourServerName;" + ;
"DATABASE=pubs;" + ;
"UID=YourUserID;" + ;
"PWD=YourPassword")
lcFieldInfo = ""
FOR EACH FIELD IN oRecordSet.FIELDS
? "Field name: ", FIELD.NAME, ;
" Type: ", LTRIM(STR(FIELD.TYPE)), ;
" Defined size: ", LTRIM(STR(FIELD.DEFINEDSIZE)), ;
" Actual size: ", LTRIM(STR(FIELD.ACTUALSIZE))
?
NEXT
沒有留言:
張貼留言