VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Dynamically generate MS Access ODBC DSN's (for VbNick)

Royce Powers  (4 Submissions)   Databases/Data Access/DAO/ADO   Visual Basic 3.0   Advanced   Wed 3rd February 2021

Class object that can be compiled or copied and pasted into your application that will dynamically create MS Access ODBC DSN's for you.

Inputs
ODBC Type, ODBC Name, MDB Path, Optional User ID, Optional Password

Assumes
Copy and Paste into your app, or compile and call the object.

Returns
Success code-Integer; Creates ODBC DSN

API Declarations
Declare Function SQLAllocConnect Lib "odbc32.dll" (ByVal henv _
As Long, phdbc As Long) As Integer
Declare Function SQLDisconnect Lib "odbc32.dll" (ByVal hdbc As _
Long) As Integer
Declare Function SQLConnect Lib "odbc32.dll" (ByVal hdbc As _
Long, ByVal szDSN As String, ByVal cbDSN As Integer, ByVal szUID As _
String, ByVal cbUID As Integer, ByVal szAuthStr As String, ByVal _
cbAuthStr As Integer) As Integer
Declare Function SQLFreeEnv Lib "odbc32.dll" (ByVal henv As _
Long) As Integer
Declare Function SQLFreeConnect Lib "odbc32.dll" (ByVal hdbc _
As Long) As Integer
Declare Function SQLError Lib "odbc32.dll" (ByVal henv As _
Long, ByVal hdbc As Long, ByVal hstmt As Long, ByVal szSqlState As _
String, pfNativeError As Long, ByVal szErrorMsg As String, ByVal _
cbErrorMsgMax As Integer, pcbErrorMsg As Integer) As Integer
Declare Function SQLConfigDataSource Lib "ODBCCP32" _
(ByVal hwndParent As Long, ByVal fRequest As Long, _
ByVal lpszDriver As String, ByVal lpszAttributes As String) As Long

Rate Dynamically generate MS Access ODBC DSN's (for VbNick) (2(2 Vote))
Dynamically generate MS Access ODBC DSN's (for VbNick).bas

Dynamically generate MS Access ODBC DSN's (for VbNick) Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters