developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks




EncryptPWD in NotesSQL ODBC SystemDSN Connection
Ian Chivers 12/10/2008 05:24 AM
Toolkits All Releases Windows Vista; Windows 2003; Windows 2000; Windows XP; Windows NT; Windows 95; Windows 98


I have a vbscript that creates NotesSQL System DSN connections. However Notes encrypts the EncyptPWD registry key value and I can't figure out if I can replicate what it does when you manually create a System DSN connection.

If I do a @Password("<password>") it gives me the first part of the EncryptPWD value, but I have no idea what the second part is made up of. In the example below this would be: 3AABC11CE5CC66A3859F9E1F8F161F52. I don't know where it gets the rest 33BB011220AEA30DD025C535A3832242835A7B9A from.

Here's my vbscript file:

LivePath = "Solutions\wip\"
Driver = "C:\NotesSQL\nsql32.dll"
EncryptPWD = "3AABC11CE5CC66A3859F9E1F8F161F5233BB011220AEA30DD025C535A3832242835A7B9A"
KeepTempIdx = "1"
MapSpecialChars = "Y"
MaxLongVarcharLen = "1000"
MaxRels = "20"
MaxStmtLen = "4096"
MaxSubquery = "20"
MaxVarcharLen = "1000"
Server = "tndevsvrr7"
ShowImplicitFlds = "0"
ThreadTimeout = "60"
UserName = "Domino Connector/Development"

' LIVE Connections
' --------------------------

DataSourceName = "Test One"
Database = LivePath + "live.nsf"
Description = "Example Database"
createSystemDSN

Msgbox "ODBC System DSN connections created!"

' Script to create the System DSN connection
' -----------------------------------------------------------------

Sub createSystemDSN
SystemFolder= 1
Set fso = wscript.CreateObject("Scripting.FileSystemObject")
Set SysFolder =fso.GetSpecialFolder(SystemFolder)
SysFolderPath= SysFolder.Path
DriverName = "Lotus NotesSQL Driver (*.nsf)"
Set WshShell = WScript.CreateObject("WScript.Shell")
RegEdPath= "HKLM\SOFTWARE\ODBC\ODBC.INI\" & DataSourceName & "\"
WshShell.RegWrite RegEdPath , ""
WshShell.RegWrite RegEdPath & "Database" , Database
WshShell.RegWrite RegEdPath & "Description" , Description
WshShell.RegWrite RegEdPath & "Driver" , Driver
WshShell.RegWrite RegEdPath & "EncryptPWD" , EncryptPWD
WshShell.RegWrite RegEdPath & "KeepTempIdx" , KeepTempIdx
WshShell.RegWrite RegEdPath & "MapSpecialChars" , MapSpecialChars
WshShell.RegWrite RegEdPath & "MaxLongVarcharLen" , MaxLongVarcharLen
WshShell.RegWrite RegEdPath & "MaxRels" , MaxRels
WshShell.RegWrite RegEdPath & "MaxStmtLen" , MaxStmtLen
WshShell.RegWrite RegEdPath & "MaxSubquery" , MaxSubquery
WshShell.RegWrite RegEdPath & "MaxVarcharLen" , MaxVarcharLen
WshShell.RegWrite RegEdPath & "Server" , Server
WshShell.RegWrite RegEdPath & "ShowImplicitFlds" , ShowImplicitFlds
WshShell.RegWrite RegEdPath & "ThreadTimeout" , ThreadTimeout
WshShell.RegWrite RegEdPath & "UserName" , UserName
WshShell.RegWrite "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\" & DataSourceName , DriverName
End Sub

Go back