PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
"Runtime error 70 access denied" on windows 7-VBForums
Results 1 to 11 of 11

Thread: "Runtime error 70 access denied" on windows 7

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    5

    "Runtime error 70 access denied" on windows 7

    hi,

    My VB 6.0 application is using the remote server ( windows 2003 ) to connect database. for that i have used UNC path to connect . i am successfully login and able to access application. but i am getting the following error when i am trying to populate/tab feilds with data on tha application:

    "Runtime error 70 access denied"

    the same thing is working fine on windows XP machines but not working on windows 7 machine.

    please help me to resolve the issue.

    thank you



    regards

    srinivas

  2. #2

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Posts
    19,262

    Re: "Runtime error 70 access denied" on windows 7

    Or correct the security on the folder holding your MDB file, as well as the existing MDB file itself to provide proper access to Standard User level credentials. At lest it sounds like you have an MDB involved here.

    The big question is "Why are you making your users admins?" Otherwise they ought to be failing on XP as well unless the right security is set up for the folder.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,135

    Re: "Runtime error 70 access denied" on windows 7

    Quote Originally Posted by dilettante View Post
    The big question is "Why are you making your users admins?" Otherwise they ought to be failing on XP as well unless the right security is set up for the folder.
    It's a great question which is often raised by security officer or auditor.
    Where I work there is no way anyone can have admin privileges - I must agree setting proper folder access is more approriate way to handle this situation.

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    5

    Re: "Runtime error 70 access denied" on windows 7

    i tried run as adminstrator. still it is giving the same error. when i click my mouse on text feild to eneter data it is giving that:
    Runtime error 70 access denied"

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    5

    Re: "Runtime error 70 access denied" on windows 7

    my users are administrators. they are able to run application fine on XP but not on windows 7.
    when i am trying enter text on text feild it is giving the error

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,135

    Re: "Runtime error 70 access denied" on windows 7

    Quote Originally Posted by srinivaskanumuri View Post
    i tried run as adminstrator. still it is giving the same error. when i click my mouse on text feild to eneter data it is giving that:
    Runtime error 70 access denied"
    I suppose it's a textbox you're refering to. Is there any code under keypress or keydown/up events?

  8. #8

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    5

    Re: "Runtime error 70 access denied" on windows 7

    Quote Originally Posted by RhinoBull View Post
    I suppose it's a textbox you're refering to. Is there any code under keypress or keydown/up events?


    as per my understanding, my code is using sendkeys like below:

    Private Sub txtStartDay_Click()
    SendKeys "{right 2}", True
    SendKeys "+{left 2}", True

    i have read in windows 7 will not support sendkeys. could you please provide alternative for sendkeys to resolver this "runtime error 70 permission denied"

    need you help!


    thanks,
    srinivas
    Last edited by srinivaskanumuri; Sep 29th, 2011 at 06:59 AM. Reason: need to add something to my prob

  9. #9
    PowerPoster
    Join Date
    Dec 2004
    Posts
    23,825

    Re: "Runtime error 70 access denied" on windows 7

    you could have told us it was sendkeys causing the problem at the start

    you can use keybd_event API
    vb Code:
    1. Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
    2.   ByVal bScan As Byte, ByVal dwFlags As Long, _
    3.   ByVal dwExtraInfo As Long)
    you will need to search for the correct key constants, you may need to pass values for keydown and keyup to release
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  10. #10

    Thread Starter
    New Member
    Join Date
    Sep 2011
    Posts
    5

    Re: "Runtime error 70 access denied" on windows 7

    Quote Originally Posted by westconn1 View Post
    you could have told us it was sendkeys causing the problem at the start

    you can use keybd_event API
    vb Code:
    1. Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
    2.   ByVal bScan As Byte, ByVal dwFlags As Long, _
    3.   ByVal dwExtraInfo As Long)
    you will need to search for the correct key constants, you may need to pass values for keydown and keyup to release

    thanks for responding....

    my code is using sendkeys and aslo keypress like below:

    Private Sub txtCityCnty_KeyPress(keyascii As Integer)
    If keyascii = 13 Then
    cmdContinue_Click
    End If

    it is not using any keydown and keyup in my code. could you please let me know which methods exactly need to use in the keybd_event API

    thank you,
    srinivas

  11. #11
    Frenzied Member
    Join Date
    Mar 2008
    Posts
    1,137

    Re: "Runtime error 70 access denied" on windows 7

    Sendkeys works as advertised in compiled exe files but gives error 70 in the IDE. So determine if the code is being run under the IDE, determine the host OS and then use Wscript.Shell.SendKeys which works just like vba.Sendkeys but does not trigger the error.

    Copy the following into a module and just use SendKeys as usual;

    Code:
    Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
    
    'get os version
    Private Type OSVERSIONINFO
      dwOSVersionInfoSize As Long
      dwMajorVersion As Long
      dwMinorVersion As Long
      dwBuildNumber As Long
      dwPlatformID As Long
      szCSDVersion As String * 128
    End Type
    
    Private Declare Function GetVersionEx Lib "kernel32.dll" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
    
    
    Public Sub Sendkeys(Text$, Optional wait As Boolean = False)
    
        Static init As Boolean, IsIDEUnderVista As Boolean, WshShell As Object
        
        'wrapper for Sendkeys which does not cause an Error 70 in the IDE under Windows Vista/ 7
        'WshShell does not get set to Nothing before App ends but any problems related to that only happen in the IDE
        'Errors due to WScript disablement on the OS can only happen under the IDE
        'Extra overhead for the WshShell object is only required under the IDE
    
        If Not init Then
            If IsDevEnv() Then
                IsIDEUnderVista = (OsVersion() >= 6)
                If IsIDEUnderVista Then Set WshShell = CreateObject("WScript.Shell")
            End If
            init = True
        End If
        
        If Not IsIDEUnderVista Then
            VBA.Sendkeys Text$, wait
        Else
            WshShell.Sendkeys Text$, wait
        End If
        
    End Sub
    
    Public Function IsDevEnv() As Boolean
    
        Dim strFileName$
        Dim lngCount&
        
        strFileName = String(255, 0)
        lngCount = GetModuleFileName(App.hInstance, strFileName, 255&)
        strFileName = Left(strFileName, lngCount)
        
        IsDevEnv = (UCase(Right(strFileName, 7)) Like "VB?.EXE")
    
    End Function
    
    Function OsVersion() As Single
        
        Dim os As OSVERSIONINFO
        Dim RetVal As Long
        os.dwOSVersionInfoSize = Len(os)
        RetVal = GetVersionEx(os)  ' read Windows's version information
        
    '    MsgBox "Windows version number:" & os.dwMajorVersion & Chr(Asc(".")) & os.dwMinorVersion
    '    MsgBox "OS Version Info Size = " & os.dwOSVersionInfoSize
    '    MsgBox "BuildNumber = " & os.dwBuildNumber
    '    MsgBox "Platform ID = " & os.dwPlatformID 'Note If ID =0 win 3.x , ID=1 win9x and ID =2 WINNT
    '    MsgBox "CSD Version = " & os.szCSDVersion
        
        
        OsVersion = Val(os.dwMajorVersion & "." & os.dwMinorVersion)
    
    End Function

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width