by Sameer Kamat (2 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 29th August 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Programmatically creates a DSN using DAO
API Declarations
Dim dbE As New DAO.DBEngine
Dim strAttr As String 'used to define the attributes to be specified for the DSN
strAttr = strAttr & vbCr & "description=programmatically created DSN" 'description
strAttr = strAttr & vbCr & "pwd=a" 'password
strAttr = strAttr & vbCr & "uid=admin" 'login name
db.RegisterDatabase "myDSN", "Microsoft Access Driver (*.mdb)", False, strAttr