Click here to Skip to main content
15,923,083 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pause commands Pin
moraalg27-Mar-03 16:27
moraalg27-Mar-03 16:27 
GeneralRe: pause commands Pin
Mike Upton27-Mar-03 4:53
Mike Upton27-Mar-03 4:53 
GeneralRe: pause commands Pin
InternetMill28-Mar-03 4:23
InternetMill28-Mar-03 4:23 
GeneralHtmlHelp HH_DISPLAY_TEXT_POPUP format Pin
Telefonen27-Mar-03 4:29
Telefonen27-Mar-03 4:29 
GeneralActiveX related question Pin
Shah Shehpori27-Mar-03 4:12
sussShah Shehpori27-Mar-03 4:12 
GeneralRe: ActiveX related question Pin
Cedric Moonen27-Mar-03 4:32
Cedric Moonen27-Mar-03 4:32 
GeneralGDI performance (Re) Pin
Raphael Kindt27-Mar-03 4:07
Raphael Kindt27-Mar-03 4:07 
GeneralNever-ending Visual Studio Pin
Adrian Metcalfe27-Mar-03 3:40
Adrian Metcalfe27-Mar-03 3:40 
GeneralRe: Never-ending Visual Studio Pin
Roger Allen28-Mar-03 0:46
Roger Allen28-Mar-03 0:46 
GeneralRe: Never-ending Visual Studio Pin
John R. Shaw28-Mar-03 17:35
John R. Shaw28-Mar-03 17:35 
GeneralSS_RIGHT style but without wrapping... Pin
Hamzeh27-Mar-03 3:35
Hamzeh27-Mar-03 3:35 
GeneralUsing Windows 2000 Debugging Symbols in VC++ 6.0 Pin
GPT99927-Mar-03 3:32
GPT99927-Mar-03 3:32 
GeneralRe: Using Windows 2000 Debugging Symbols in VC++ 6.0 Pin
Chris Richardson27-Mar-03 9:01
Chris Richardson27-Mar-03 9:01 
GeneralResizable font Pin
Cedric Moonen27-Mar-03 3:29
Cedric Moonen27-Mar-03 3:29 
GeneralRe: Resizable font Pin
Tibor Blazko27-Mar-03 3:44
Tibor Blazko27-Mar-03 3:44 
GeneralRe: Resizable font Pin
Cedric Moonen27-Mar-03 3:51
Cedric Moonen27-Mar-03 3:51 
GeneralRe: Resizable font Pin
Iain Clarke, Warrior Programmer27-Mar-03 4:21
Iain Clarke, Warrior Programmer27-Mar-03 4:21 
GeneralRe: Resizable font Pin
Cedric Moonen27-Mar-03 4:24
Cedric Moonen27-Mar-03 4:24 
GeneralAutostart Pin
Jump_Around27-Mar-03 3:08
Jump_Around27-Mar-03 3:08 
GeneralRe: Autostart Pin
Pavel Klocek27-Mar-03 3:16
Pavel Klocek27-Mar-03 3:16 
GeneralRe: Autostart Pin
Pavel Klocek27-Mar-03 3:20
Pavel Klocek27-Mar-03 3:20 
GeneralRe: Autostart Pin
Jump_Around27-Mar-03 4:11
Jump_Around27-Mar-03 4:11 
GeneralExecute a DTS in SQL7 Pin
JPortugal27-Mar-03 3:07
JPortugal27-Mar-03 3:07 
Hi all gurus!
I'm a C# junior progr but dont know anything about C or Visual C ( funny isn't? ).
Well, i must do aplication just to execute a DTS in a Labeled Server. No fancy error message things. Just execute, since this apl will be trigged by a job. I've search the web for some info about this, but only came with http://sqldev.net/dts/ExecutePackage.htm, but i cant override the fatal error C1083: Cannot open type library file: 'C:\MSSQL7\BINN\dtspkg.dll': Error loading type library/DLL. I've register this dll again and checked the rll. But the error continue. I'm using w2k logged as Adm.
<br />
#define STRICT <br />
#define WIN32_LEAN_AND_MEAN <br />
#define INC_OLE2 <br />
#define UNICODE <br />
#define _UNICODE <br />
<br />
#include <windows.h> <br />
#include <stdio.h> <br />
#include <tchar.h><br />
#include <comdef.h> // COM Compiler support for _bstr_t<br />
#include "execpkg.h"<br />
<br />
#import "C:\MSSQL7\BINN\dtspkg.dll" \<br />
no_namespace rename("EOF", "EndOfFile") <br />
<br />
INT _tmain(INT argc, TCHAR* argv[], TCHAR* envp)<br />
{<br />
    HRESULT hr;<br />
    if SUCCEEDED(hr = OleInitialize(NULL) )<br />
    {<br />
try<br />
{<br />
    HRESULT hr;<br />
            _Package2Ptr spPackage;<br />
            if (SUCCEEDED(spPackage.CreateInstance(__uuidof(Package2))))<br />
            {<br />
                try<br />
                {<br />
                    _variant_t v; // VarPersistStgOfHost<br />
                    hr = spPackage->LoadFromSQLServer(<br />
                        _T("(local)"),             // _bstr_t ServerName<br />
                        _T(""),     // _bstr_t ServerUserName<br />
                        _T(""),     // _bstr_t ServerPassword<br />
                        DTSSQLStgFlag_UseTrustedConnection,   <br />
                        _T(""),     // _bstr_t PackagePassword<br />
                        _T(""),     // _bstr_t PackageGuid<br />
                        _T(""),     // _bstr_t PackageVersionGuid<br />
                        _T("Teste"),                  // _bstr_t PackageName<br />
                        &v);     // VARIANT* pVarPersistStgOfHost<br />
                    hr = spPackage->Execute();<br />
                    hr = spPackage->UnInitialize();<br />
                }<br />
                catch(_com_error pCE)<br />
                {<br />
                    spPackage.Release();     // Free the interface<br />
                }<br />
            }<br />
        }<br />
        catch(_com_error pCE)<br />
        {<br />
<br />
        }<br />
<br />
        OleUninitialize();<br />
    }<br />
    return (0);<br />
}<br />


I need some help, please.
Tks all

J.Portugal
GeneralRe: Execute a DTS in SQL7 Pin
Anders Molin27-Mar-03 11:22
professionalAnders Molin27-Mar-03 11:22 
GeneralRe: Execute a DTS in SQL7 Pin
JPortugal27-Mar-03 21:46
JPortugal27-Mar-03 21:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.