Hi, this is pretty strange. I've got this string that connect to a SQLServer in the same domain as the computers are running and compares username with employeeID. Then takes that row and dumps it into the lokal computers registry. This is working in Windows XP, but not Windows 7 it seems.
I get this exact error message:
Line:39
Char:1
Error: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Code: 80004005
Source: Microsoft OLE DB Provider for SQL Server.
This is the script itself. I've removed the actual servernames. Reckon nobody needs those.
Set oConn = CreateObject("ADODB.Connection")
oConn.Open "Provider=sqloledb;Data Source=mysqlserver04\mysqlserver04;Initial Catalog=orginfo;Integrated Security=SSPI"
sSQL = "select top 1 * from dbo.Mal_personinfo where empid = '" & EID & "'"
'wscript.echo sSQL
set rs = oConn.Execute(sSQL)
set oSystem = CreateObject("WScript.Shell")
for iTeller = 0 to rs.fields.count - 1
Text = Text & rs.fields(iTeller).Name & "=" & rs.fields(iTeller).Value & " - "
oSystem.RegWrite "HKCU\Software\MalData\" & rs.fields(iTeller).Name,rs.fields(iTeller).Value,"REG_SZ"
next
'wscript.echo Text
Why does this work on Windows XP but not Windows 7?