Permissions problem with ADOX and CreateProcess() on WinXP Pro 
Author Message
 Permissions problem with ADOX and CreateProcess() on WinXP Pro

I have a DLL created with MSVC 6 that uses ADOX to create a database.
This DLL is called by a third party app, which is in turn launched by
my VB 6 app using CreateProcess().  When the DLL attempts to create
the database:

        TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (ADOX::Catalog)));
        m_pCatalog->Create(bstrConn);

I get a _com_error exception at the Create() call:

        COM error #: -2147467262
        COM error source: Provider
        COM error desc: No such interface supported

Here's the VB code:

        Dim pi As PROCESS_INFORMATION
        Dim si As STARTUPINFO
        Dim sa As SECURITY_ATTRIBUTES
        dim lRes As Long

        ' Init the STARTUPINFO struct
        si.dwFlags = STARTF_USESHOWWINDOW
        si.wShowWindow = SW_SHOWDEFAULT
        si.cb = LenB(si)
        ' Init the SECURITY_ATTRIBUTES
        sa.nLength = LenB(sa)
        sa.bInheritHandle = False
        sa.lpSecurityDescriptor = 0
        ' Call the Win32 API function CreateProcess
        ' strExe is a String that contains the path and filename of the
        ' executable.  strDir contains the path.
        lRes = CreateProcess(vbNullString, strExe, sa, sa, True, _
                0, vbNull, strDir, si, pi)

Conditions:

  o If I launch the third party .exe directly (by doubleclicking on it
    or running it from the commandline) it works perfectly

  o I am running it under a user ID that is a member of the
    Administrators group and has rights to the entire HD

  o The problem does not occur under Windows 2000 Pro (also using
    Admin member user ID)

  o The XP box has MDAC 2.7, the Win2K boxes have MDAC 2.6

Help!

--
Charles Calvert             |  Software Design/Development
Celtic Wolf, Inc.           |  Project Management
http://www.*-*-*.com/ ;|  Technical Writing
(703) 580-0210              |  Research



Sun, 05 Jun 2005 04:06:21 GMT  
 Permissions problem with ADOX and CreateProcess() on WinXP Pro
It looks like the problem is caused by the lpProcessAttributes  and
lpThreadAttributes  you passed. Please try to use the Shell function in VB
to run the exe and see whether it works.

Shell(pathname[,windowstyle])

Regards,
Gang Guo
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com



Sun, 05 Jun 2005 16:01:20 GMT  
 Permissions problem with ADOX and CreateProcess() on WinXP Pro

Quote:

>It looks like the problem is caused by the lpProcessAttributes  and
>lpThreadAttributes  you passed.

That's my thought as well.  However, I don't know exactly what's
missing.

Quote:
>Please try to use the Shell function in VB to run the exe and see
>whether it works.

>Shell(pathname[,windowstyle])

I tested it under Win2K (CreateProcess() works under Win2K).  It
works.  I'll test it under XP tonight when I get back to my office.

--
Charles Calvert             |  Software Design/Development
Celtic Wolf, Inc.           |  Project Management
http://www.celticwolf.com/  |  Technical Writing
(703) 580-0210              |  Research



Mon, 06 Jun 2005 00:19:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help, VB6 Pro WinXP Pro Win98 2nd

2. Excel 97 on WinXP Pro, early bound problems in VB

3. VBA - ActiveDocument.Save with WINXP Pro

4. Scripting engine under WinXP Pro?

5. VB97 and VB6 crashing in WinXP Pro

6. Different behavior between Win2000 and WinXP Pro

7. ADOX and Permissions

8. NTFS Permissions in XP PRO for ASP Changes to MS Access File

9. VBA problem using RDO on WinXP or 2000 with Excel97

10. strange scripting problem in IE6 on WinXP

11. PROBLEM!!-->VB Application/IE6 crashing behavior when running a WinNT built app on WinXP

12. User interface problems on WinXP

 

 
Powered by phpBB® Forum Software