The object variable or with block variable is not set.

Source: Internet
Author: User

 

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.**.***"

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.