does anybody know if can this be done,,,What type of Script are you referring to?
Rand
This posting is provided "as is" with no warranties and confers no rights.|||Here's a simple script that I've used to create ODBC DSN's for SQL Server
OPTION EXPLICIT
Dim sDSN
Dim sDB
Dim sDescription
Dim sDriverDLL
Dim sDriverName
Dim sSQLServer
Dim sRegPath
Dim oFSO
Dim oSystemFolder
Dim sSystemFolderPath
DIM oWshShell
Const cSystemFolder = 1
Set oFSO = wscript.CreateObject("Scripting.FileSystemObject")
Set oSystemFolder = oFSO.GetSpecialFolder(cSystemFolder)
sSystemFolderPath = oSystemFolder.Path
sDSN = "MyDSN3"
sDB = "pubs"
sDescription = "My New Data Source"
sDriverDLL = sSystemFolderPath & "\sqlsrv32.dll"
sSQLServer = "MySQLServer"
sDriverName = "SQL Server"
Set oWshShell = WScript.CreateObject("WScript.Shell")
sRegPath = "HKLM\SOFTWARE\ODBC\ODBC.INI\" & sDSN & "\"
oWshShell.RegWrite sRegPath , ""
oWshShell.RegWrite sRegPath & "Database" , sDB
oWshShell.RegWrite sRegPath & "Description" , sDescription
oWshShell.RegWrite sRegPath & "Driver" , sDriverDLL
oWshShell.RegWrite sRegPath & "Server" , sSQLServer
oWshShell.RegWrite sRegPath & "Trusted_connection" , "Yes"
oWshShell.RegWrite "HKLM\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\" & sDSN ,
sDriverName
wscript.Quit
Mike O.
"Sean" <myocard@.hotmail.com> wrote in message
news:C3LKb.4111$9k7.91187@.news.xtra.co.nz...
quote:
> I'm like to create some sql server odbc dsn's by using a script.
> does anybody know if can this be done,,,
>
>
No comments:
Post a Comment