How To Create and Remove a DSN in Visual Basic (171146)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 4.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 4.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Standard Edition for Windows 4.0
This article was previously published under Q171146 SUMMARY
In the 32-bit version of Visual Basic 4.0, it is possible to use DSN-less
connections, but because the 16-bit version of ODBC can not handle this
syntax, it is not possible to do this in the 16-bit version of Visual Basic
4.0. It is possible to emulate this ability by dynamically creating and
removing a Data Source Name (DSN) on the fly using the SQLConfigDataSource
ODBC API call.
The following is a 16-and 32-bit example that demonstrates this technique.
The 32-bit code was included because this technique has other uses as
described below. The 32-bit techniques presented in this article also apply
to Visual Basic 5.0.
REFERENCES
ODBC 2.0 Programmer's Reference and SDK Guide
Microsoft Press 1993
ISBN 1-55615-658-8
(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by
Troy Cambra, Microsoft Corporation
Modification Type: | Minor | Last Reviewed: | 7/15/2004 |
---|
Keywords: | kbhowto KB171146 |
---|
|