----------------------------explanations from the Internet---------------------------------
Dim is used to define a variable, set to specify an object for a variable, or to assign a value to an object variable.
Like Dim a
In fact, VBScript can not be defined directly on the use of
a=10
Dim conn
Set Conn=server.createobject ("Adodb.connection")
Set cannot be omitted.
------------------------------the content of self understanding---------------------------------
ASP language, Option explict force definition variable (good programming habits, preferably open)
① define variable →② variable assignment
Copy Code code as follows:
Dim A, conn ' here defines two variables, where we define a as a non-object variable (variable type), while Conn is an object variable (variable type)
A = "This is the test!!!" ' We assign a value to this variable, which is a string variable without the SET statement because it is not an object variable
Set Conn=server.createobject ("Adodb.connection") ' When we assign a value to this object variable we need to use the SET statement.
Dim is generally used to declare variables such as Dim variable name as data type
Set is generally used to assign values to special data types, such as those written above, because it is not possible to assign values simply by using the = number. Generally, connection command Recordset, and so on, are assigned using set.