Results 1 to 8 of 8

Thread: Windows 7 issue?

  1. #1

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    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
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  2. #2
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Windows 7 issue?

    SSPI error?

  3. #3

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    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.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  4. #4

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    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
    Last edited by Pasvorto; Apr 4th, 2011 at 02:25 PM.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  5. #5

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Windows 7 issue?

    Nobody has any idea yet?
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    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.
    Last edited by LaVolpe; Jul 13th, 2011 at 05:02 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Windows 7 issue?

    It isn't a VB6 error but a SQL Server Provider error. Maybe see:

    How to troubleshoot the "Cannot generate SSPI context" error message

    PRB: Error: 80004005 - MS ODBC SQL Server Driver Cannot Initialize SSPI Package

    Oops, I duplicated an anonymous link above.

  8. #8

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Windows 7 issue?

    Tried all that stuff. I wish I could come up with what is different about the 3 that work.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width