Configure the data source and ODBC Data Source deployment types and access permissions in win7 (Windows service cannot access the data source)

Source: Internet
Author: User
Tags odbc connection

Add items under win7 to the Start Menu. The following describes how to add a management tool to the Start Menu.
Right-click at the bottom of the desktop-properties-Start Menu-custom-system management tools-Program"Menu and" start "menu display

Then you can set the ODBC data source as in XP.

 

For ODBC Data Source deployment types and access permissions, refer to the http://dcx.sybase.com/1201/zh/dbprogramming/connection-information-client-deploy.html#nowhere

    1. The user data source defines a location stored in the registry, which contains the settings of specific users currently logged on to the system.

    2. However, the system data source is available to all users and Windows Services, regardless of whether the user logs on to the system or not. Given a correctly configured system data source named MyApp, any user can use this ODBC Data Source by providing DSN = MyApp In the ODBC connection string.

    3. File data sources are not stored in the registry, but stored on disks. The connection string must provide filedsn connection parameters to use the file data source. The default location of the file data source is
      HKEY_CURRENT_USER \ Software \ ODBC. ini \ ODBC file DSN \ defaultdsndirRegistry entry or
      HKEY_LOCAL_MACHINE \ SOFTWARE \ ODBC. ini \ ODBC file DSN \ defaultdsndirThe registry entry (if the former is not defined) is specified. The path can be included in the filedsn connection parameters to locate the data source when the file data source is located elsewhere.

Recently, I wrote a Windows service to access the database. I have never been able to use ODBC API sqlconnect, after finding the data source for more than one day, we finally found that if the Windows service program does not log on, it will not have the permission to access the user data source, as long as it is configured as the system data source When configuring the data source.

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.