~jterrell/nunitv2/nunitv2

« back to all changes in this revision

Viewing changes to tools/WiX/sdk/inc/sqlutil.h

  • Committer: Charlie Poole
  • Date: 2012-02-02 01:55:11 UTC
  • mfrom: (3368.1.11 work)
  • Revision ID: charlie@nunit.org-20120202015511-0sspxs5miu16uzse
Merge changes from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
//-------------------------------------------------------------------------------------------------
 
3
// <copyright file="sqlutil.h" company="Microsoft">
 
4
//    Copyright (c) Microsoft Corporation.  All rights reserved.
 
5
//    
 
6
//    The use and distribution terms for this software are covered by the
 
7
//    Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
 
8
//    which can be found in the file CPL.TXT at the root of this distribution.
 
9
//    By using this software in any fashion, you are agreeing to be bound by
 
10
//    the terms of this license.
 
11
//    
 
12
//    You must not remove this notice, or any other, from this software.
 
13
// </copyright>
 
14
// 
 
15
// <summary>
 
16
//    SQL helper functions.
 
17
// </summary>
 
18
//-------------------------------------------------------------------------------------------------
 
19
 
 
20
#include <cguid.h>
 
21
#include <oledberr.h>
 
22
#include <sqloledb.h>
 
23
 
 
24
 
 
25
#ifdef __cplusplus
 
26
extern "C" {
 
27
#endif
 
28
 
 
29
// Adding this until the SQL annotations are published to specstrings.h
 
30
#ifndef __sql_command
 
31
#define __sql_command
 
32
#endif
 
33
 
 
34
// structs
 
35
struct SQL_FILESPEC
 
36
{
 
37
    WCHAR wzName[MAX_PATH];
 
38
    WCHAR wzFilename[MAX_PATH];
 
39
    WCHAR wzSize[MAX_PATH];
 
40
    WCHAR wzMaxSize[MAX_PATH];
 
41
    WCHAR wzGrow[MAX_PATH];
 
42
};
 
43
 
 
44
 
 
45
// functions
 
46
HRESULT DAPI SqlConnectDatabase(
 
47
    __in_z LPCWSTR wzServer, 
 
48
    __in_z LPCWSTR wzInstance,
 
49
    __in_z LPCWSTR wzDatabase, 
 
50
    __in BOOL fIntegratedAuth, 
 
51
    __in_z LPCWSTR wzUser, 
 
52
    __in_z LPCWSTR wzPassword, 
 
53
    __out IDBCreateSession** ppidbSession
 
54
    );
 
55
HRESULT DAPI SqlStartTransaction(
 
56
    __in IDBCreateSession* pidbSession,
 
57
    __out IDBCreateCommand** ppidbCommand,
 
58
    __out ITransaction** ppit
 
59
    );
 
60
HRESULT DAPI SqlEndTransaction(
 
61
    __in ITransaction* pit,
 
62
    __in BOOL fCommit
 
63
    );
 
64
HRESULT DAPI SqlDatabaseExists(
 
65
    __in_z LPCWSTR wzServer,
 
66
    __in_z LPCWSTR wzInstance,
 
67
    __in_z LPCWSTR wzDatabase,
 
68
    __in BOOL fIntegratedAuth,
 
69
    __in_z LPCWSTR wzUser,
 
70
    __in_z LPCWSTR wzPassword,
 
71
    __out_opt BSTR* pbstrErrorDescription
 
72
    );
 
73
HRESULT DAPI SqlSessionDatabaseExists(
 
74
    __in IDBCreateSession* pidbSession,
 
75
    __in_z LPCWSTR wzDatabase,
 
76
    __out_opt BSTR* pbstrErrorDescription
 
77
    );
 
78
HRESULT DAPI SqlDatabaseEnsureExists(
 
79
    __in_z LPCWSTR wzServer,
 
80
    __in_z LPCWSTR wzInstance,
 
81
    __in_z LPCWSTR wzDatabase,
 
82
    __in BOOL fIntegratedAuth,
 
83
    __in_z LPCWSTR wzUser,
 
84
    __in_z LPCWSTR wzPassword,
 
85
    __in_opt const SQL_FILESPEC* psfDatabase,
 
86
    __in_opt const SQL_FILESPEC* psfLog,
 
87
    __out_opt BSTR* pbstrErrorDescription
 
88
    );
 
89
HRESULT DAPI SqlSessionDatabaseEnsureExists(
 
90
    __in IDBCreateSession* pidbSession,
 
91
    __in_z LPCWSTR wzDatabase,
 
92
    __in_opt const SQL_FILESPEC* psfDatabase,
 
93
    __in_opt const SQL_FILESPEC* psfLog,
 
94
    __out_opt BSTR* pbstrErrorDescription
 
95
    );
 
96
HRESULT DAPI SqlCreateDatabase(
 
97
    __in_z LPCWSTR wzServer,
 
98
    __in_z LPCWSTR wzInstance,
 
99
    __in_z LPCWSTR wzDatabase,
 
100
    __in BOOL fIntegratedAuth,
 
101
    __in_z LPCWSTR wzUser,
 
102
    __in_z LPCWSTR wzPassword,
 
103
    __in_opt const SQL_FILESPEC* psfDatabase,
 
104
    __in_opt const SQL_FILESPEC* psfLog,
 
105
    __out_opt BSTR* pbstrErrorDescription
 
106
    );
 
107
HRESULT DAPI SqlSessionCreateDatabase(
 
108
    __in IDBCreateSession* pidbSession,
 
109
    __in_z LPCWSTR wzDatabase,
 
110
    __in_opt const SQL_FILESPEC* psfDatabase,
 
111
    __in_opt const SQL_FILESPEC* psfLog,
 
112
    __out_opt BSTR* pbstrErrorDescription
 
113
    );
 
114
HRESULT DAPI SqlDropDatabase(
 
115
    __in_z LPCWSTR wzServer,
 
116
    __in_z LPCWSTR wzInstance,
 
117
    __in_z LPCWSTR wzDatabase,
 
118
    __in BOOL fIntegratedAuth,
 
119
    __in_z LPCWSTR wzUser,
 
120
    __in_z LPCWSTR wzPassword,
 
121
    __out_opt BSTR* pbstrErrorDescription
 
122
    );
 
123
HRESULT DAPI SqlSessionDropDatabase(
 
124
    __in IDBCreateSession* pidbSession,
 
125
    __in_z LPCWSTR wzDatabase,
 
126
    __out_opt BSTR* pbstrErrorDescription
 
127
    );
 
128
HRESULT DAPI SqlSessionExecuteQuery(
 
129
    __in IDBCreateSession* pidbSession, 
 
130
    __in __sql_command LPCWSTR wzSql, 
 
131
    __out_opt IRowset** ppirs,
 
132
    __out_opt DBROWCOUNT* pcRows,
 
133
    __out_opt BSTR* pbstrErrorDescription
 
134
    );
 
135
HRESULT DAPI SqlCommandExecuteQuery(
 
136
    __in IDBCreateCommand* pidbCommand, 
 
137
    __in __sql_command LPCWSTR wzSql, 
 
138
    __out IRowset** ppirs,
 
139
    __out DBROWCOUNT* pcRows
 
140
    );
 
141
HRESULT DAPI SqlGetErrorInfo(
 
142
    __in IUnknown* pObjectWithError,
 
143
    __in REFIID IID_InterfaceWithError,
 
144
    __in DWORD dwLocaleId,
 
145
    __out_opt BSTR* pbstrErrorSource,
 
146
    __out_opt BSTR* pbstrErrorDescription
 
147
    );
 
148
 
 
149
#ifdef __cplusplus
 
150
}
 
151
#endif