2
//-------------------------------------------------------------------------------------------------
3
// <copyright file="sqlutil.h" company="Microsoft">
4
// Copyright (c) Microsoft Corporation. All rights reserved.
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.
12
// You must not remove this notice, or any other, from this software.
16
// SQL helper functions.
18
//-------------------------------------------------------------------------------------------------
29
// Adding this until the SQL annotations are published to specstrings.h
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];
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
55
HRESULT DAPI SqlStartTransaction(
56
__in IDBCreateSession* pidbSession,
57
__out IDBCreateCommand** ppidbCommand,
58
__out ITransaction** ppit
60
HRESULT DAPI SqlEndTransaction(
61
__in ITransaction* pit,
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
73
HRESULT DAPI SqlSessionDatabaseExists(
74
__in IDBCreateSession* pidbSession,
75
__in_z LPCWSTR wzDatabase,
76
__out_opt BSTR* pbstrErrorDescription
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
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
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
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
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
123
HRESULT DAPI SqlSessionDropDatabase(
124
__in IDBCreateSession* pidbSession,
125
__in_z LPCWSTR wzDatabase,
126
__out_opt BSTR* pbstrErrorDescription
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
135
HRESULT DAPI SqlCommandExecuteQuery(
136
__in IDBCreateCommand* pidbCommand,
137
__in __sql_command LPCWSTR wzSql,
138
__out IRowset** ppirs,
139
__out DBROWCOUNT* pcRows
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