Imports System
Imports System.Environment
...
...
...
Dim key, key1 As RegistryKey
Dim subkey, subkey1 As RegistryKey
key = Registry.LocalMachine
subkey = key.CreateSubKey("SOFTWARE\ODBC\ODBC.INI\NEWDSN") Line AB
subkey.SetValue("database", "wbamar") your dbname
subkey.SetValue("description", "") default
subkey.SetValue("driver", SystemDirectory.ToString & "\" & "myodbc.dll") driver for mySQL
subkey.SetValue("option", "0") default 0
subkey.SetValue("password", "") your pass
subkey.SetValue("port", "3306") default is 3306
subkey.SetValue("server", "MYCOMP") name of server/computer or localhost
subkey.SetValue("stmt", "") default
subkey.SetValue("user", "root") your uname
key.Close()
subkey.Close()
key1 = Registry.LocalMachine
subkey1 = key.OpenSubKey("SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", True)
subkey1.SetValue("NEWDSN", "MySQL") first value must me
same as name in line Line AB
key1.Close()
subkey1.Close()