>I’m trying to programmatically create an ODBC datasource. So this is what I’m doing:
>
>DECLARE Integer SQLConfigDataSource IN odbccp32.dll ;
>Integer, Short, String @, String @
>lc_driver = "SQL Server" + CHR(0)
>lc_dsn = "DSN=MyServer" + CHR(0)
>...blah blah
>
>This far works. Now I go to the OBDC and the new User DSN 'MyServer', I click on "Configure" to see what it actually did, and of course, the user id and password is not there because I don’t want that, I want to use
> “With Windows NT authentication using network login ID”
>How do I include in the code to have that checked?
You would pass that as an additional parameter in your lc_dsn string. Edit the registry and go to HKEY_CURRENT_USER\Software\ODBC\ODBC.INI to see all the data strings [parameters] and data [values] you can pass.
I also have a free ODBC DSN class for VFP in the Files section in the Win32/API category. It is heavily commented and includes sample code.
Mark McCasland
Midlothian, TX USA