VC ++ study notes -- An error occurred while connecting to SQL using VB. SQL does not exist or access is denied.

Source: Internet
Author: User
Tags sql using

This is the last routine in Sun Xin's video. Use VB and VC ++ 6.0 to link and access the database. The ADO method is used. Because you want to access SQL Server. So I installed an SQL Server version. Run VC ++ before installation.ProgramAlways prompt that an unknown error occurs (I used a try or catch statement); when connecting to the database in VB, I always prompt that the SQL server does not exist or the access is denied. Check whether SQL Server is installed on my computer. At that time, I thought that the database was built by the system (I only blame myself for being too stupid and naive ). Then download SQL Server 2000 pack4 and install it. But the program is still that error. Okay, I'm so stupid again. Use the patch as the installation package.

This download is correct. However, a problem occurs during installation. The error message is as follows: a previously installed program has created a pending file on the computer. You need to restart the computer before running the installation. I restarted it, but I still cannot. Later, Baidu took the following three steps and I directly reproduced them:

1. Check whether SQL Server exists in the Add/delete programs on the control panel. (None of mine)

2. Delete all directories of SQL Server that have not been deleted. (I have never installed it at all, but my predecessors may have installed it, and I have not managed it. I just went through step 1)

3. open the Registry Editor (START-> Run-> enter Regedit), and find the pendingfilerenameoperations item in HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager to delete it. Then you can install it smoothly.

After the installation, you need to access SQL Server. You must first start its service manager. Forgive me for having never touched any databases before. This is also a new knowledge for me.

Finally, the database is connected successfully!

 

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.