Common problems with SQL Server-real-time error: '91 'object variable or with Block Variable not set

Source: Internet
Author: User

Such a problem is undoubtedly the first difficult problem for beginners like ours after getting started with SQL Server, "Real-time error '91 'object variable or with Block Variable not set" is exposed in the end? I still can't see anything until I write this blog post, but I know some of the reasons. Is there a problem with it, or is it difficult for me to understand the mystery?

 

 

But now I don't want to investigate too much. I feel like I can solve the problem and I will understand it later.

According to my contact with the database these days, this problem occurs every time, becauseDatabase not connected"CauseAs a beginner in the database, I don't know how others are doing. Anyway, I feel like I have encountered the most problems. The most difficult problem is the connection of the database, however, what makes me quite puzzled is that I had encountered such a problem on the Internet for a whole afternoon, and almost no ideal answer was found on Baidu, I am wondering if you have never met this hurdle when learning databases? Or is it ever better?

Some factors that cause database connection failure include:

1. The service manager does not start the service.

2. The "file DSN" in the data source (ODBC) contains the added database.

3. The default database accessed in "Enterprise Manager-security-login" is not set as the database you want to access, and can be changed in the attribute.

4. InCode"Select * from" should be followed by the table name, rather than the database name.

5. the username or password in connectstring is incorrect (you can modify it in the Secure Login of the corresponding server in the Enterprise Manager, previously, when running on my laptop, if this location is incorrect, it would not work. On the landlord's desktop, no matter whether the user name and password are incorrect or deleted, the connection can be successful, only the first few word errors do not work. When the executesql () function runs, connectstring () is triggered. Therefore, connectstring () is equivalent to an event that must be triggered during database connection, the strings must be correctly written. Otherwise, the connection to the database is directly affected.

6. I always felt that there was something I did not remember, maybe there was still a source, the night was deep, and there was a breeze, the incandescent people were not sleeping, close the door, waiting for another morning, looking for the goddess in the dream, lie down! Lie down!

Related Article

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.