API call to register ODBC data source? 
Author Message
 API call to register ODBC data source?

I need to be able to dynamically register an ODBC connection to a SQL
server database from Access 2.0 or Access 95.  Due to the user profiles on
our WinNT3.51 network any datasources added via the control panel are lost
when the user's machine is rebooted.  I am sure that there must be a API
function to do this but I do not have access to the NT SDK.  Any help would
be greatly appreciated.

Paul Northrop



Sat, 29 Apr 2000 03:00:00 GMT  
 API call to register ODBC data source?

I don't know about Access 2.0 and 95, but in Access 97 (v 8.0) see help
under the "RegisterDatabase Method."  This method registers the OBDC
database in the Windows Registry without resort to an API call.  Is it
available in Access 95 (v 7.0)?



Quote:
> I need to be able to dynamically register an ODBC connection to a SQL
> server database from Access 2.0 or Access 95.  Due to the user profiles
on
> our WinNT3.51 network any datasources added via the control panel are
lost
> when the user's machine is rebooted.  I am sure that there must be a API
> function to do this but I do not have access to the NT SDK.  Any help
would
> be greatly appreciated.

> Paul Northrop



Sat, 29 Apr 2000 03:00:00 GMT  
 API call to register ODBC data source?

Check out http://premium.microsoft.com/msdn/

Under the Library section, you'll find the complete ODBC SDK documentation.
Be aware of that there are different DLL's for 32 and 16 bit
implementations.

Here are the VB declares for the function you need.

#If Win16 Then
    Private Declare Function SQLConfigDataSource Lib "odbcinst.dll" _
                                                (ByVal hWnd As Integer, _
                                                 ByVal iRefresh As Integer,
_
                                                 ByVal szDriver As String,
_
                                                 ByVal szattributes As
String _
                                                ) As Integer
#ElseIf Win32 Then
    Private Declare Function SQLConfigDataSource Lib "odbccp32.dll" _
                                                (ByVal hWnd As Long, _
                                                 ByVal iRefresh As Long, _
                                                 ByVal szDriver As String,
_
                                                 ByVal szattributes As
String _
                                                ) As Integer
#End If

--
Steve Czulewicz
STEELOX Systems, Inc.

** Remove NOSPAM from address to reply by email **



Quote:
> I need to be able to dynamically register an ODBC connection to a SQL
> server database from Access 2.0 or Access 95.  Due to the user profiles
on
> our WinNT3.51 network any datasources added via the control panel are
lost
> when the user's machine is rebooted.  I am sure that there must be a API
> function to do this but I do not have access to the NT SDK.  Any help
would
> be greatly appreciated.

> Paul Northrop



Mon, 01 May 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Registering an ODBC Data Source

2. Programatically register ODBC System Data Source??

3. Programatically register ODBC System Data Source??

4. Programatically register ODBC System Data Source??

5. api call for data source name

6. ODBC.ini - How can I get all ODBC Data Sources

7. ODBC vs ODBC API Calls

8. Problems with data control in VB 4.0 and ODBC data sources

9. error 3265 when accessing odbc data source through data control

10. Data Form Wizard and ODBC Data Source

11. Syntax for importing data into an Access table from an ODBC data source

12. how to use API calls to register components ?

 

 
Powered by phpBB® Forum Software