Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP60- ODBC
Message
From
21/04/2000 17:30:11
 
 
To
20/04/2000 15:02:06
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00362005
Message ID:
00362379
Views:
26
>Article ID Q142216 shows how to create a Data Source programatically. The problem is that every time I create one it goes to the USER DSN location. I need to create one in the SYSTEM DSN location.
>
>Does anybody in here know how to do this? Thank you in advance.

I have not read the article, but if you're doing this via the registry, create it under HKEY_CURRENT_USER rather than under HKEY_LOCAL_MACHINE. It will only be visible to the user that is logged in at the time you create the DSN.

If you're calling SQLConfigDataSource, the second argument of the API call defines if it's a user or system DSB. THe following is cut from the ODBCINST.H file that comes with VC++
#define  ODBC_ADD_DSN     1               // Add data source
#define  ODBC_CONFIG_DSN  2               // Configure (edit) data source
#define  ODBC_REMOVE_DSN  3               // Remove data source

#if (ODBCVER >= 0x0250)
#define  ODBC_ADD_SYS_DSN 4				  // add a system DSN
#define  ODBC_CONFIG_SYS_DSN	5		  // Configure a system DSN
#define  ODBC_REMOVE_SYS_DSN	6		  // remove a system DSN
#if (ODBCVER >= 0x0300)
#define	 ODBC_REMOVE_DEFAULT_DSN	7		// remove the default DSN
#endif  /* ODBCVER >= 0x0300 */
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform