-
Windows 7 issue?
I have a small program that works just fine on Windows XP boxes. However, when I run it on a Windows 7 box, I get a SSPI error. As you can see, all it does is copy a file and exit it. I am wondering if the "shell" is the issue.
Code:
Private Sub Form_Load()
Dim filefrom As String
Dim FileTo As String
Dim Command As String
filefrom = "Z:\PARTS\MACHINEPARTS.EXE"
FileTo = "C:\PARTS\MACHINEPARTS.EXE"
Command = "C:\PARTS\MACHINEPARTS.EXE"
'first copy file
FileCopy filefrom, FileTo
'now fire up the program
Shell Command, 1
End
End Sub
-
Re: Windows 7 issue?
-
Re: Windows 7 issue?
yeah, I hear ya. I will try to get the user to run it again so I can get the exact message. For now, I just manually copied the exe to their C: drive and ran it there with no problem. So, I know the program itself is not the issue.
-
Re: Windows 7 issue?
OK. The error says that it "cannot initialize SSPI package". Bear in mind, if the user fires up the exe from their C: drive, everything is fine. If they use the utility program to copy the current version and THEN execute it, they get the error.
The routine that is tripping the error is where I set up the databases that will be accessed.
Code:
Public Sub DBLogin()
On Error GoTo errorhandler
Set CnxnArch = New ADODB.Connection
Set CnxnPR = New ADODB.Connection
Set CnxnTechSQL = New ADODB.Connection
Set CnxnTempSQL = New ADODB.Connection
Set CnxnProdSched = New ADODB.Connection
'
'----------------------------------------------------
'== Set up in the various routines, as needed ====
'-----------------------------------------------------
'
CnxnArch.Provider = "SQLOLEDB"
CnxnArch.Properties("Data Source").Value = "Primero"
CnxnArch.Properties("Initial Catalog").Value = "Archive"
CnxnArch.Properties("Integrated Security").Value = "SSPI"
CnxnArch.Open
'
'-----------------------------
'== Set up TimeCard interface
'-----------------------------
'
CnxnPR.Provider = "SQLOLEDB"
CnxnPR.Properties("Data Source").Value = "Primero"
CnxnPR.Properties("Initial Catalog").Value = "TimeCards"
CnxnPR.Properties("Integrated Security").Value = "SSPI"
'
'---------------------------
'== Set up Techni interface
'---------------------------
'
CnxnTechSQL.Provider = "SQLOLEDB"
CnxnTechSQL.Properties("Data Source").Value = "Primero"
CnxnTechSQL.Properties("Initial Catalog").Value = "Techni"
'
'//////////////////////////////////////////////////////////////////
'CnxnTechSQL.Properties("Initial Catalog").Value = "TechniTest"
'//////////////////////////////////////////////////////////////////
'
CnxnTechSQL.Properties("Integrated Security").Value = "SSPI"
CnxnTechSQL.Open
myPasswordTechniSQL = "pac"
'
'--------------------------------
'== Set up Temporary interface
'--------------------------------
'
CnxnTempSQL.Provider = "SQLOLEDB"
CnxnTempSQL.Properties("Data Source").Value = "Primero"
CnxnTempSQL.Properties("Initial Catalog").Value = "Temporary"
CnxnTempSQL.Properties("Integrated Security").Value = "SSPI"
CnxnTempSQL.Open
'
'===========================
Set rs = New ADODB.Recordset
'===========================
loginOK = ""
sql = "SELECT [USERID] FROM *****ERS WHERE LTRIM(RTRIM(UPPER([USERID]))) = " & "'" & Trim(UCase(frmUserLogIn.txtUserID.Text)) & "'"
sql = sql & " AND LTRIM(RTRIM(UPPER([PASSWORD]))) = " & "'" & Trim(UCase(frmUserLogIn.txtPass.Text)) & "'"
rs.Open sql, CnxnTechSQL, adOpenKeyset, adLockReadOnly, adCmdText
If Not rs.BOF And Not rs.EOF Then
loginOK = "X"
Else
frmUserLogIn.txtUserID.SetFocus
MsgBox "Invalid Login"
rs.Close
Set rs = Nothing
'================
Exit Sub
End If
rs.Close
Set rs = Nothing
'================
Exit Sub
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
errorhandler:
Screen.MousePointer = 0
MsgBox "An error occurred: [" & Err.Number & "] " & Err.DESCRIPTION & " - Source: (Routines)DBLogin"
End Sub
-
Re: Windows 7 issue?
-
Re: Windows 7 issue?
See if this Microsoft article sheds any light
Edited: Another possibility for that error is that you are deploying a custom DLL named Security.dll. If so, don't name it that. You may want to google for that error message and do more research.
-
Re: Windows 7 issue?
-
Re: Windows 7 issue?
Tried all that stuff. I wish I could come up with what is different about the 3 that work.