Permissions problem with ADOX and CreateProcess() on WinXP Pro

Permissions problem with ADOX and CreateProcess() on WinXP Pro

Post by Charles Calver » Thu, 19 Dec 2002 05:06:21



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.celticwolf.com/  |  Technical Writing
(703) 580-0210              |  Research

 
 
 

Permissions problem with ADOX and CreateProcess() on WinXP Pro

Post by ¥x?W·L3n¨t2?¤?′?3 » Thu, 19 Dec 2002 17:01:20


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

 
 
 

Permissions problem with ADOX and CreateProcess() on WinXP Pro

Post by Charles Calver » Fri, 20 Dec 2002 01:19:43




>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

 
 
 

1. 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.celticwolf.com/  |  Technical Writing
(703) 580-0210              |  Research

2. NJ-Somerset-93723--C-C++-Client/Server-GUPTA SQL WINDOWS-MS Office-NCR-ORACLE-Pr

3. Help, VB6 Pro WinXP Pro Win98 2nd

4. Q: pl/sql checking the existence of a record ?

5. ADOX, C# , WINXP

6. US-CO-Foxpro Administrators - Full Time

7. Install SQL2000 Entrps on WinXp pro

8. Updating a table using stored procedures.

9. MSDE 2000 install halts on WinXP Pro at final server config step

10. Upgrading from Win98SE to WinXP Pro

11. SqlServer2000 on WinXP Pro?

12. AS2K on WinXP Pro?

13. SQL2K Dev - WinXP Pro