The rest of the entries are specific to the driver for the new data source. Often it is not necessary to supply all of the entries because the driver can prompt the user with dialog boxes for the new values. You might want to explicitly supply default values so that the user is not prompted. This gives you a list of installed drivers and their descriptions. Use this description as the lpszDriver parameter.
As an alternative, you can examine the registry or, for 16 bit, the file Odbcinst. One way to find the keynames and values for the lpszAttributes parameter is to examine the Odbc.
Select the data source you want, for example, SQL Server. The items following the string "pub:" are, in order, the keyname and value to use in your lpszAttributes parameter. These are exactly the entries to use in your lpszAttributes parameter. You might also want to examine the documentation for the specific driver you are going to use. You can find useful information in the online Help for the driver, which you can access by running ODBC Administrator.
When ODBC Administrator displays the information for creating a new data source for that particular driver, click Help. This opens the Help file for that particular driver, which generally contains important information concerning the use of the driver.
Skip to main content. The driver name part needs to be delimited by curly braces if it might contain special characters, and needs to exactly match the installed driver name, as found in the ODBC Data Source Administrator, including spaces and typographical characters, but excluding capitalization.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Why am I getting "Data source name not found and no default driver specified" and how do I fix it? Ask Question. Asked 2 years, 2 months ago. Active 2 years, 2 months ago. Viewed 26k times. I'm sure my code is right.
It even worked on a different PC. Why am I getting this error? And How do I fix it? Improve this question. Erik A Erik A Add a comment. Active Oldest Votes. Need more help? Expand your skills.
Get new features first. Was this information helpful? Yes No. Thank you! Any more feedback? The more you tell us the more we can help. Can you help us improve? Resolved my issue.
0コメント