Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Ado Datatypes in ASP

Ado Datatypes in ASP

In Classic ASP, when working with ADO (ActiveX Data Objects) — especially when using ADODB.Command with parameters — you often need to specify ADO data types.

These types are constants (numeric values) used with CreateParameter.


? Commonly Used ADO DataTypes

Constant NameValueDescriptionEquivalent SQL Type
adInteger3Integer (4 bytes)INT
adSmallInt2Small integer (2 bytes)SMALLINT
adTinyInt16Tiny integer (1 byte)TINYINT
adBigInt20Large integer (8 bytes)BIGINT
adVarChar200Variable-length stringVARCHAR
adChar129Fixed-length stringCHAR
adVarWChar202Unicode variable-length stringNVARCHAR
adWChar130Unicode fixed-length stringNCHAR
adBoolean11True/FalseBIT, BOOLEAN
adDate7Date with timeDATETIME, DATE
adDBTimeStamp135Date and timeTIMESTAMP
adDouble5Double-precision floatFLOAT, DOUBLE
adSingle4Single-precision floatREAL
adCurrency6CurrencyMONEY
adDecimal14DecimalDECIMAL
adNumeric131NumericNUMERIC
adLongVarChar201Large textTEXT, LONGTEXT
adLongVarBinary205Binary data (e.g. images)IMAGE, BLOB, VARBINARY(MAX)

? Example: Using DataType in CreateParameter

Set cmd = Server.CreateObject("ADODB.Command")Set cmd.ActiveConnection = conncmd.CommandText = "INSERT INTO Users (Name, Age, IsActive) VALUES (?, ?, ?)"cmd.CommandType = 1 ' adCmdTextcmd.Parameters.Append cmd.CreateParameter("Name", 200, 1, 50, "John")         ' adVarCharcmd.Parameters.Append cmd.CreateParameter("Age", 3, 1, , 30)                  ' adIntegercmd.Parameters.Append cmd.CreateParameter("IsActive", 11, 1, , True)          ' adBoolean

? Tips

  • Direction: 1 = adParamInput, 2 = adParamOutput

  • Always match ADO data types with the expected column types in your database.

  • adVarChar and adVarWChar require a length parameter.


Let me know if you want the full list of all ADO types or just those relevant to a specific database (like SQL Server or Access).

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql