Here is how I do it. This will only create Access or Sql Server ODBCs.
1) Copy the following code and make it into a module.
2) Make a backup copy of folder "Setup1" under C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard
3) Rename setup1.exe to setup1.old under C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard
4) open Setup1.vbp file and add the module you created.
5) In the form_load section call the functions to create the appropriate ODBC.
6) create new setup1.exe
7) copy setup1.exe into C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard
8) create new setup package
9) NOTE Delete or rename the new Setup1.exe and rename the old back to setup1.exe (if not all setups from here on out will create the DSN's)
Hope this helps.
''Code for module
Option Explicit
Private Const SQL_SUCCESS As Long = 0 ' ODBC Success
Private Const SQL_ERROR As Long = -1 ' ODBC Error
Private Const SQL_FETCH_NEXT As Long = 1 ' ODBC Move Next
Private Declare Function SQLDataSources Lib "ODBC32.DLL" _
(ByVal hEnv As Long, ByVal fDirection _
As Integer, ByVal szDSN As String, _
ByVal cbDSNMax As Integer, pcbDSN As Integer, _
ByVal szDescription As String, ByVal cbDescriptionMax _
As Integer, pcbDescription As Integer) As Integer
Private Declare Function SQLAllocEnv Lib "ODBC32.DLL" _
(env As Long) As Integer
Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" _
(ByVal hwndParent As Long, ByVal fRequest As Long, _
ByVal lpszDriver As String, ByVal lpszAttributes As String) _
As Long
Private Const ODBC_ADD_SYS_DSN = 4
'
Public Sub GetDSNs()
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: :::
'::: This routine does the actual work :::
'::: :::
'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'
Dim intRetCode As Integer ' the return code
Dim strDSNItem As String ' the dsn name
Dim strDRVItem As String ' the driver name
Dim strDSN As String ' the formatted dsn name
Dim intDSNLen As Integer ' the length of the dsn name
Dim intDRVLen As Integer ' the length of the driver name
Dim hEnv As Long ' handle to the environment
Dim strTemp As String ' Tempspace
Dim strDSNTemp As String ' Tempspace
Dim int_Ct As Integer
Dim int_Ct2 As Integer
Dim str_DSN_Hold() As String
On Error Resume Next
ReDim str_DSN_Hold(0 To 5000)
If (SQLAllocEnv(hEnv) <> SQL_ERROR) Then
Do
strDSNItem = Space$(1024)
strDRVItem = Space$(1024)
intRetCode = SQLDataSources(hEnv, SQL_FETCH_NEXT, strDSNItem, _
Len(strDSNItem), intDSNLen, strDRVItem, _
Len(strDRVItem), intDRVLen)
strDSN = Left$(strDSNItem, intDSNLen)
' If (Len(strDSN) > 0) And (strDSN <> Space$(intDSNLen)) Then
' strDSNTemp = strDSN & vbTab & "(" & _
' Left$(strDRVItem, intDRVLen) & "

|"
' ' Check for dupes...
' If InStr(strTemp, strDSNTemp) = 0 Then
' strTemp = strTemp & strDSNTemp
' End If
' End If
If UCase(Mid$(strDRVItem, 1, 10)) = "SQL SERVER" Or _
UCase(Mid$(strDRVItem, 1, 23)) = "MICROSOFT ACCESS DRIVER" Then
str_DSN_Hold(int_Ct) = ""
For int_Ct2 = 1 To Len(Trim$(strDSNItem))
If Asc(Mid$(strDSNItem, int_Ct2, 1)) >= 32 And Asc(Mid$(strDSNItem, int_Ct2, 1)) < 127 Then
str_DSN_Hold(int_Ct) = str_DSN_Hold(int_Ct) + Mid$(strDSNItem, int_Ct2, 1)
End If
Next int_Ct2
int_Ct = int_Ct + 1
End If
Loop Until intRetCode <> SQL_SUCCESS
End If
ReDim g_str_DSN(0 To int_Ct - 1)
For int_Ct = 0 To UBound(g_str_DSN)
g_str_DSN(int_Ct) = str_DSN_Hold(int_Ct)
Next int_Ct
End Sub
'******* The following code will add a DSN
Public Function CreateSQLServerDSN(DSNName As String, _
Description As String, ServerName As String, Database As String) As Boolean
'PURPOSE: 'CREATES A SYSTEM DSN FOR AN SQL SERVER DATABASE
'PARAMETERS: 'DSNName = DSN Name
'ServerName = Name of Server
'Database = Database to Use
'RETURNS: True if successful, false otherwise
'EXAMPLE: CreateSQLServerDSN "MyDSN", "MyServer", "MyDatabase"
Dim sAttributes As String
sAttributes = "DSN=" & DSNName & Chr(0)
sAttributes = sAttributes & "DESCRIPTION=" & Description & Chr(0)
sAttributes = sAttributes & "Server=" & ServerName & Chr(0)
sAttributes = sAttributes & "Database=" & Database & Chr(0)
sAttributes = sAttributes & "Trusted_Connection=No"
CreateSQLServerDSN = CreateDSN("SQL Server", sAttributes)
End Function
Public Function CreateAccessDSN(DSNName As String, _
DatabaseFullPath As String, bln_ReadOnly As Boolean) As Boolean
'PURPOSE: 'CREATES A SYSTEM DSN FOR AN ACCESS DATABASE
'PARAMETERS: 'DSNName = DSN Name
'DatabaseFullPath = Full Path to .mdb file
'RETURNS: True if successful, false otherwise
'EXAMPLE: CreateAccessDSN "MyDSN", "C:\MyDb.mdb"
Dim sAttributes As String
'TEST TO SEE IF FILE EXISTS: YOU CAN REMOVE IF YOU
'DON'T WANT IT
If Dir(DatabaseFullPath) = "" Then Exit Function
sAttributes = "DSN=" & DSNName & Chr(0)
sAttributes = sAttributes & "DBQ=" & DatabaseFullPath & Chr(0)
If bln_ReadOnly = True Then
sAttributes = sAttributes & "ReadOnly=1" & DatabaseFullPath & Chr(0)
Else
sAttributes = sAttributes & "ReadOnly=0" & DatabaseFullPath & Chr(0)
End If
CreateAccessDSN = CreateDSN("Microsoft Access Driver (*.mdb)", _
sAttributes)
End Function
Public Function CreateDSN(Driver As String, Attributes As _
String) As Boolean
'PURPOSE: CREATES A SYSTEM DSN
'PARAMETERS: 'Driver = DriverName
'ATTRIBUTES: 'Attributes; varies as a function
'of the Driver
'EXAMPLE: Refer to Code Above
CreateDSN = SQLConfigDataSource(0&, ODBC_ADD_SYS_DSN, _
Driver, Attributes)
End Function
****** Code for frmSetup1 Form_Load
If CreateSQLServerDSN("DSN", "Description", "Server", "Password"

Then
End If
If CreateAccessDSN("DSN", "Path of MDB", True) Then
End If