windows 7 - VBscript - SQL Connection fails SQL Server does not exist or access denied -
this pretty strange. i've got string connect sqlserver in same domain computers running , compares username employeeid. takes row , dumps lokal computers registry. working in windows xp, not windows 7 seems.
i exact error message:
line:39 char:1 error: [dbnetlib][connectionopen (connect()).]sql server not exist or access denied. code: 80004005 source: microsoft ole db provider sql server.
this script itself. i've removed 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 * dbo.mal_personinfo empid = '" & eid & "'" 'wscript.echo ssql set rs = oconn.execute(ssql) set osystem = createobject("wscript.shell") iteller = 0 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 work on windows xp not windows 7?
since you're using integrated security, let me ask account running application. did add account user database? if not, , it's admin account, you're relying on old "admins can everything" , under windows 7 that's not true more.
to test this, try running application elevated (right click exe , run administrator.) cause keep "admin-ness" , might let database. if works, don't continue run elevated, instead go sql , add user. app should work fine non-elevated.
Comments
Post a Comment