Since I started learning about databases, this problem has always been around me. From the very beginning, there were five simple database instances. The current student information management system. In fact, I am not afraid of this problem,
The object variable or block with variable is not set. In fact, the database objects you set are not instantiated, that is, they are connected to your database.
When we are connecting to a database,
First, object variables must be declared first.
Second, use the set statement to assign a correct reference to the object variable. Use the new set statement to set a new reference for the object. (Note that when we use the set statement to define a type, if the pop-up boxes of those types are not automatically displayed, note that you have not referenced the object library. Specific steps: Project -- reference -- Microsoft ActiveX date objects 2.5 Library)
Third, if there is a problem with other settings (Database settings), open your eyes and check the code for your database connection. Maybe it isA space. Single quotes and uppercase/lowercase lettersProblem.
Appendix (careful check ):
ConnectString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=***;PassWord=***;Initial Catalog=Student;Data Source=192.168.**.***"