Ошибка 2147467259 sql

I want to create a database in the installation process using WiX 3.6. I followed many tutorials, but I think there is something I am doing wrong.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
     xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension">

    <Product Id="{A704CA9E-2833-4276-A8A8-148F1047332F}" Name="DbInstallerTest" Language="1033" Version="1.0.0.0" Manufacturer="Microsoft" UpgradeCode="2de42bd8-acc2-48bf-b3c6-09745d3a2ea4">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate />

        <Feature Id="ProductFeature" Title="DbInstallerTest" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="DbInstallerTest" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">

            <Component Id="CMPDbInsatller"
                       Guid="{1749E57D-9CE4-42F8-924C-2A2E368B51E4}">
                <CreateFolder Directory="INSTALLFOLDER"/>
                <util:User Id="SqlUser"
                           Name="sa"
                           Password="Abc123@"/>
            </Component>
            <Component Id="cmp2"
                       Guid="{C3596364-61A0-4628-9153-1BA11DB4B778}">
                <CreateFolder Directory="INSTALLFOLDER"/>
                <sql:SqlDatabase Id="Id_db"
                                 Database="TestDatabase1"
                                 Server="(local)\SQLExpress"
                                 CreateOnInstall="yes"
                                 User="SqlUser"
                                 DropOnUninstall="yes">
                </sql:SqlDatabase>
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

The above code gives the following error.

Error -2147467259: failed to create SQL database: TestDatabase1. error detail: Unknown error.

Here is the log content,

=== Logging started: 2/18/2013  11:00:59 ===
Action 11:00:59: INSTALL.
Action start 11:00:59: INSTALL.
Action 11:00:59: FindRelatedProducts. Searching for related applications
Action start 11:00:59: FindRelatedProducts.
Action ended 11:00:59: FindRelatedProducts. Return value 1.
Action 11:00:59: LaunchConditions. Evaluating launch conditions
Action start 11:00:59: LaunchConditions.
Action ended 11:00:59: LaunchConditions. Return value 1.
Action 11:00:59: ValidateProductID.
Action start 11:00:59: ValidateProductID.
Action ended 11:00:59: ValidateProductID. Return value 1.
Action 11:00:59: CostInitialize. Computing space requirements
Action start 11:00:59: CostInitialize.
Action ended 11:00:59: CostInitialize. Return value 1.
Action 11:00:59: FileCost. Computing space requirements
Action start 11:00:59: FileCost.
Action ended 11:00:59: FileCost. Return value 1.
Action 11:00:59: CostFinalize. Computing space requirements
Action start 11:00:59: CostFinalize.
Action ended 11:00:59: CostFinalize. Return value 1.
Action 11:00:59: MigrateFeatureStates. Migrating feature states from related applications
Action start 11:00:59: MigrateFeatureStates.
Action ended 11:00:59: MigrateFeatureStates. Return value 0.
Action 11:00:59: ExecuteAction.
Action start 11:00:59: ExecuteAction.
Action start 11:01:01: INSTALL.
Action start 11:01:01: FindRelatedProducts.
Action ended 11:01:01: FindRelatedProducts. Return value 0.
Action start 11:01:01: LaunchConditions.
Action ended 11:01:01: LaunchConditions. Return value 1.
Action start 11:01:01: ValidateProductID.
Action ended 11:01:01: ValidateProductID. Return value 1.
Action start 11:01:01: CostInitialize.
Action ended 11:01:01: CostInitialize. Return value 1.
Action start 11:01:01: FileCost.
Action ended 11:01:01: FileCost. Return value 1.
Action start 11:01:01: CostFinalize.
Action ended 11:01:01: CostFinalize. Return value 1.
Action start 11:01:01: MigrateFeatureStates.
Action ended 11:01:01: MigrateFeatureStates. Return value 0.
Action start 11:01:01: InstallValidate.
Action ended 11:01:01: InstallValidate. Return value 1.
Action start 11:01:01: RemoveExistingProducts.
Action ended 11:01:01: RemoveExistingProducts. Return value 1.
Action start 11:01:01: InstallInitialize.
Action ended 11:01:01: InstallInitialize. Return value 1.
Action start 11:01:01: ProcessComponents.
Action ended 11:01:01: ProcessComponents. Return value 1.
Action start 11:01:01: UnpublishFeatures.
Action ended 11:01:01: UnpublishFeatures. Return value 1.
Action start 11:01:01: UninstallSqlData.
Action ended 11:01:02: UninstallSqlData. Return value 1.
Action start 11:01:02: RemoveFiles.
Action ended 11:01:02: RemoveFiles. Return value 0.
Action start 11:01:02: RemoveFolders.
Action ended 11:01:02: RemoveFolders. Return value 1.
Action start 11:01:02: CreateFolders.
Action ended 11:01:02: CreateFolders. Return value 1.
Action start 11:01:02: ConfigureUsers.
Action start 11:01:02: CreateUserRollback.
Action ended 11:01:02: CreateUserRollback. Return value 1.
Action start 11:01:02: CreateUser.
Action ended 11:01:02: CreateUser. Return value 1.
Action ended 11:01:02: ConfigureUsers. Return value 1.
Action start 11:01:02: InstallFiles.
Action ended 11:01:02: InstallFiles. Return value 1.
Action start 11:01:02: InstallSqlData.
Action start 11:01:19: CreateDatabase.
Action ended 11:01:19: CreateDatabase. Return value 1.
Action ended 11:01:19: InstallSqlData. Return value 1.
Action start 11:01:19: RegisterUser.
Action ended 11:01:19: RegisterUser. Return value 1.
Action start 11:01:19: RegisterProduct.
Action ended 11:01:19: RegisterProduct. Return value 1.
Action start 11:01:19: PublishFeatures.
Action ended 11:01:19: PublishFeatures. Return value 1.
Action start 11:01:19: PublishProduct.
Action ended 11:01:19: PublishProduct. Return value 1.
Action start 11:01:19: InstallFinalize.
CreateDatabase:  Error 0x80004005: failed to create to database: 'TestDatabase1', error:

unknown error
Error 26201. Error -2147467259: failed to create SQL database: TestDatabase1, error detail:

unknown error.
MSI (s) (94!44) [11:01:47:973]: Product: DbInstallerTest -- Error 26201. Error -2147467259:

failed to create SQL database: TestDatabase1, error detail: unknown error.

CustomAction CreateDatabase returned actual error code 1603 (note this may not be 100%

accurate if translation happened inside sandbox)
Action ended 11:01:47: InstallFinalize. Return value 3.
Action ended 11:01:48: INSTALL. Return value 3.
Action ended 11:01:48: ExecuteAction. Return value 3.
Action ended 11:01:48: INSTALL. Return value 3.
=== Logging stopped: 2/18/2013  11:01:48 ===
MSI (c) (C0:94) [11:01:48:208]: Product: DbInstallerTest -- Installation failed.

MSI (c) (C0:94) [11:01:48:209]: Windows Installer installed the product. Product Name:

DbInstallerTest. Product Version: 1.0.0.0. Product Language: 1033. Manufacturer: Microsoft.

Installation success or error status: 1603.

What am I doing wrong here?

Peter Mortensen's user avatar

asked Feb 18, 2013 at 5:43

Isuru Gunawardana's user avatar

We chased this error around for a week before finally resolving it by going into the SQL Server Configuration Manager → SQL Server Network Configuration → Protocols for MSSQLSERVER (for us, the default instance) → Enabling Named Pipes and TCP/IP protocols.

Peter Mortensen's user avatar

answered Mar 31, 2014 at 18:22

sunfallSeraph's user avatar

I was also facing this exact issue, and I browsed a lot of forums to get that solved. This was the only thing which worked for me. On my computer, SQL Server Express Edition database creation failed with
-2147467259: failed to create SQL database:

After days of hacking I finally found the solution! All you need to do
is use .\sqlexpress instead of localhost\sqlexpress or
127.0.0.1\sqlexpress in your connection string. I think (and I might be terribly wrong here) when you use .\sqlexpress in connection string
installer uses Shared Memory instead of Named Pipes or TCP/IP.

Source: Solution to -2147467259: failed to create SQL database

Peter Mortensen's user avatar

answered Apr 24, 2014 at 15:43

Soman Dubey's user avatar

Soman DubeySoman Dubey

3,8084 gold badges23 silver badges32 bronze badges

Err 26201 is more useful. You should also see more information in the event logs.

Your code indicates that you are using mixed mode on the SQL instance and authenticating as a SQL login. This indicates that the problem is likely that your SQL service account doesn’t have permissions to create the MDF and LDF files in the default locations.

See this thread for more info:

Error 26201. Error -2147467259: failed to create SQL database

answered Feb 18, 2013 at 14:34

Christopher Painter's user avatar

So I am also getting an error in my WiX installer logs also, however slightly different.

Environment:

  • WebServer = Windows 2008 R2
  • SQLServer = Windows 2008 32-bit with SQL Server 2008 R2 Standard
  • Mixed Mode Authentication
  • Default SQL Instance

Error:

ExecuteSqlStrings: Entering ExecuteSqlStrings in
C:\Windows\Installer\MSI1EC7.tmp, version 3.6.3303.0

ExecuteSqlStrings: Error 0x80004005: failed to connect to database:
‘DatabaseNameBla’

Error 26203. Failed to connect to SQL database.
(-2147467259 DatabaseNameBla ) MSI (s) (20!30) [10:16:32:225]:
Product: Bla Services — Error 26203. Failed to connect to SQL
database. (-2147467259 DatabaseNameBla )

Research:

  • Instance DB seems to have only 1.6 GB left on the hard drive. << this might be bad…
  • My user is sysadmin
  • Access Through SQL Management Tools has no problems with the same user.
  • SLQ Logs have nothing in them to assist with the error. Just noise.

My Solution:

  • VM has a D drive with 50 GB free
  • New Database Instance on D Drive
  • New Instance Set to Mixed Mode
  • Reinstalled. Success!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Summary:

So after hours of trying to figure out what the deal was. In the instance of this error, it was related to the hard drive free space size. Since the SQL Server was in production we were unable to expand the C drive to see if that fixed the default instance.

Community's user avatar

answered Apr 11, 2014 at 15:48

Omzig's user avatar

OmzigOmzig

8611 gold badge12 silver badges20 bronze badges

  • Remove From My Forums

 locked

Can’t Install SQL Server 2019 (Express Edition) | Exit code (Decimal): -2147467259Error description: The system cannot find the path specified

  • Question

  • Oops…

    Unable to install SQL Server (setup.exe.)

    Exit code (Decimal): -2147467259Error description: The system cannot find the path specified

    • Edited by

      Thursday, July 9, 2020 4:01 PM

Answers

  • i found article «Cleanly Uninstalling Stubborn SQL Server Components» and follow through step on this article

    It is work for me and then I reinstall SQL Server 2019 again but this time my install work very well.

    Sorry for my English and I can’t post link directly

    • Marked as answer by
      LotteFiber
      Thursday, July 9, 2020 3:58 PM

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
Option Compare Database
Option Explicit
 
'--------------------------------------------------------------------------
' Module    : modLink_MySQL_ADOX
' Author    : es
' Date      : 24.07.2017
' Purpose   : Переподключение таблиц MySQL без DSN
'--------------------------------------------------------------------------
' - Требует установки MySQL ODBC ODBC MySQL драйвера
'--------------------------------------------------------------------------
'Требуются ссылки на:
'    Microsoft ADO Ext. for DDL and Security. (Version 2.1 or higher)
'    Microsoft ActiveX Data Objects Library. (Version 2.1 or higher)
'--------------------------------------------------------------------------
 
 
Public ConnStr$
Private cat As ADOX.Catalog
Private tbl As ADOX.Table
Private AConnectionString_ADOX As String
Private i%, s$
 
Public Sub StartReLink_MySQL_ADOX(Optional bDelOnly As Boolean)
'Собственно процедура подключения (основная)
 
Dim arrTables() As Variant
Dim arrTables_1() As Variant
 
'--------------------------------------------------------------------------
On Error GoTo StartReLink_MySQL_ADOX_Err
    DoCmd.Hourglass True 'Показать часики
 
 
'Массив табличек:
    arrTables = Array("Amper", "Baza", "Baza_Pitatel", "Cat_Empl", "Chet", "Chet_Kompl", "Cklad", "Vid_Nomenkl_ERP", "Klaccif_Nomenkl_ERP", "Uroven_Ctrykt_ERP", _
        "Cklad_Dvig_Izd", "Cod_Empl", "Cotrydnik", "Cpecifikaciy", "Cpecifikaciy_Pza1", "Cpr_Nomenkl_ERP", "Ctryktyra_Izdely_ERP", _
        "Cpocob_Per_Zak", "Cpr_Dorabotok", "Ctr_Izd_Modyl", "Ctr_Izd_Ocnov", "Ctrana", "Licev_Nakl_Izdelie", "Licev_Nakl_Plan_Vipycka_Izd", "Licev_Nakl_Prixod", "Licev_Nakl_Racxod", "Izdelie_Licev", _
        "Ctryktyra_Izdely", "Cvoictva_Znach", "Cvoictvo_Detali", "Dolznoct", "Dop_Zamena", "Operacii_ERP", "Izdely_Operacii_ERP", _
        "Edinicy_Izmereny", "Forma_Cobctv", "Funk_Claim", "Funk_Otvetctv_Za_Vip", _
        "Funk_Pol_Inform", "Funk_Procecc", "Funk_Structure", "Funk_View", "Funk_Ychactv_V_Vip", _
        "Gorod", "Grup_Empl", "Gryp_Clozn_Rem", "Icpolnenie", "Identifikator_Izd", _
        "Invent_Cklad", "Izdelie", "Izdelie_copy", "Izdelie_Komplekty", "Izd_Preemnik", "Izdelie_Modifikaciy", "Izdelie_TO", _
        "Izdely_Gryp", "Izv_Cogl", "Izv_Cogl_Jyrnal_Cob", "Izv_Ctatyc", "Izv_Formylirovki", _
        "Izv_Izdelie", "Izv_Jyrnal_Cob", "Izv_Koment", "Izv_Koment_Jyrnal_Cob", "Izv_Modul", "Izv_Kritichnoct", _
        "Izv_Vid_Cogl", "Izveshenie", "Level_Competence", "Mecto_Xraneniy", "Modifikaciy", _
        "Modyl", "Name_Funk", "Name_Group", "NameFunk", "Necootvetctv", "Oboryd_TO", _
        "Oborydovanie", "Ogr_Cpicok", "ooDecim_Nomer", "ooGryppa_Izd", "ooKlacc_Izd", _
        "ooPodgryppa_Izd", "ooPodklacc_Izd", "ooPor_Regictr_Nomer", "ooVid_Izd", "Operaciy_Cklad", _
        "Operaciy_Oboryd", "Operaciy_Texnol", "Operaciy_Vipol", "Opicanie_Cvoictv", "Org_Ctrykt", _
        "Organizat_Role", "Otdel", "Pitatel", "Bab_Fid_Yct", "Fider", "Fider_Kompon_Progr", "Fider_Pit", _
        "Racpolozenie", "Pitatel_Partia", "Pitatel_Xarakter", "Plata_Defekt", "Poctavchik", _
        "Porycheniy", "Prichina_Vozvr_Iz_OTK", "Privyzka_Coctava", "Process", "Process_A", "Progr", "TP_Mex", "TP_Mex_Vibor", "TP_Mex_Vipoln", "Partiy_Mex", "Peremesh_Mex", _
        "Proizvod", "R_RA", "Rabota_Robotov", "Requ_For_Specialty", "Site", "Sites_1", "Texprocecc", _
        "Tip_Dokym", "Tip_Operaciy", "To_I_R", "To_I_R_Prichina", "To_I_R_Cherez_Cklad", "To_I_R_Cherez_Cklad_copy", "Obmenniy_Fond", "To_Izd", "Imiy_Shkafa", "To_Izd_Cpicok_Rab", _
        "To_Obor_Cpicok_Rab", "Verciy_PO", "Verciy_Po_Aktualn", "Vid_Rabot", "Vid_Rabot_To", _
        "Vizm_Neicpr_Napominal", "Vozm_Neicpr_Priborov", "Volt", "Vozvrat_Iz_Otk", "Vxod_Kontrol", "Zakaz", "Zakazchik", "Bx_Kontr_Nomenkl", "Bx_Kontr_Zyrnal", "Cootvetctvie", _
        "Zip", "Zip_Cklad", "Zip_Cklad_Racxod", "Zip_Dvigenie", "Zip_Imia", "Zip_Mex_Cbor", "Klacter_Remonta", "Klacter_Remonta_Org", _
        "Zip_Partiy", "Zip_Partiy_Brem_Nakleika", "Zip_Poctavshik", "Zip_Vid", "Zip_Ynikaln", "Izdelie_Verciy_PO", "Dokyment", _
        "Imenovanie", "Klassif_Schtrix", "Texprocecc_Izd", "Klaccif_Nomer_PO", "Reviziy_PO", "Tip_Failov_PO", "Remont", "Kod_1_Panel_IHM", "Kod_2_Panel_IHM", "Kod_3_Panel_IHM", "Kod_4_Panel_IHM", "Kod_Coctav_Modyley_VV", "Kod_Tip_Mezonina_Cviazi", "Kod_Tip_Modyl_Proceccora", "Kod_Tip_Razmeri_Korpyca", "Kod_Vercii_PO", "Ciriyc_New", "Ciriyc_New_Racborka")
    'arrTables = Array("Uroven_Ctrykt_ERP", "Cpr_Nomenkl_ERP", "Ctryktyra_Izdely_ERP", "Operacii_ERP", "Izdely_Operacii_ERP")
 
'--------------------------------------------------------------------------
'Предварительный промсмотр (если нужно):
    Debug.Print String(74, "-")
    For i = LBound(arrTables) To UBound(arrTables)
        s = arrTables(i)
        Debug.Print Format(i + 1, "000"); ".  " & s
    Next i
    Debug.Print String(74, "-")
    Debug.Print "Всего: " & Format(i, "00") & " таблиц " & Now
    Debug.Print String(74, "-")
'--------------------------------------------------------------------------
    'GoTo StartReLink_MySQL_ADOX_Bye
    
'Запуск
    'ReLinkTables_ADOX arrTables, "00_", bDelOnly    ' Полное переподключение
    ReLinkTables_ADOX arrTables, , bDelOnly    ' Полное пере-подключение
 
StartReLink_MySQL_ADOX_Bye:
    DoCmd.Hourglass False 'Вернуть нормальный курсор
    Exit Sub
 
StartReLink_MySQL_ADOX_Err:
    MsgBox "Error: " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
    "in procedure: StartReLink_MySQL_ADOX in module: modLink_MySQL_ADOX", _
    vbCritical, "Error in Application!": Err.Clear
    Resume StartReLink_MySQL_ADOX_Bye
        
End Sub
 
Private Sub ReLinkTables_ADOX(arrTables() As Variant, Optional sTblLocalPrefix$ = "", Optional bDelOnly As Boolean)
' Вспомогательная -  Переподключение таблиц по массиву
'--------------------------------------------------------------------------
'Аргументы:
'   arrTables()      = Массив табличек
'   sTblLocalPrefix  = Локальный префикс названий
'   bDelONly         = Только удалить и не подключать если = True (-1)
'--------------------------------------------------------------------------
Dim sTblName$
Dim sDriver As String
Dim sServerAdr As String
Dim sCharset As String
Dim sServPort As String
Dim sDbName As String
Dim sUser As String
Dim sPassWord As String
Dim l&
 
On Error GoTo ReLinkTables_ADOX_Err
 
    
    If Dir("C:\Program Files\MySQL\Connector ODBC 3.51", vbDirectory) <> "" Then
        sDriver = "{MySQL ODBC 3.51 Driver}" 'Папка Connector ODBC 3.51 существует. Драйвер для 32 разрядной операционной системы(для устаревших компьютеров- где дополниетльные программы (требующиеся для работы этого драйвера) плохо или не ставятся вовобще)
    ElseIf Dir("C:\Program Files\MySQL\Connector ODBC 5.3", vbDirectory) <> "" Then
        sDriver = "{MySQL ODBC 5.3 Unicode Driver}" 'Драйвер для 32 или драйвер для 64 разрядного MS Office - в зависимости , что установлено. Имя папки одинаковое.
    Else
        MsgBox "Нет драйвера ODBC для работы с  MySQL"
        Exit Sub
    End If
    
    'sServerAdr = "localhost"
    sServerAdr = "managementdb.rza.ru"   ' Адрес (Имя) сервера
    sServPort = "3306"         ' Порт соединения = 3306 (Обычно так и есть)
    sDbName = "management" ' Название базы
    sUser = "management"             ' Имя пользователя
    sPassWord = "123456"    ' Пароль
 
s = ""
'Создаю строку подключения:
 ConnStr = ";DRIVER=" & sDriver & _
        ";SERVER=" & sServerAdr & _
        ";Port=" & sServPort & _
        ";DATABASE=" & sDbName & _
        ";USER=" & sUser & _
        ";PASSWORD=" & sPassWord & _
        ";OPTION=3" & _
        ";stmt=set names cp1251"
        Debug.Print ConnStr
        Debug.Print String(74, "-")
    
    
'Строим строку подключения ... - добавляем "ODBC;" в начало уже готовой (см выше)
    AConnectionString_ADOX = "ODBC;" & ConnStr
 
'Катплог
    Set cat = New ADOX.Catalog
    'Открываем каталог текущей базы
    Set cat.ActiveConnection = CurrentProject.Connection
 
'Удаление всех таблиц по именам
     For i = LBound(arrTables) To UBound(arrTables)
        sTblName = arrTables(i)
        s = sTblLocalPrefix & sTblName
        DelTable_ADOX s
    Next i
    cat.Tables.Refresh
    Debug.Print String(74, "-")
 
    If bDelOnly = True Then GoTo ReLinkTables_ADOX_Bye
'Подключение  всех по именам
    For i = LBound(arrTables) To UBound(arrTables)
        sTblName = arrTables(i)
        'Debug.Print Format(i, "000") & " - " & sTblName
        LinkTable_ADOX sTblName, AConnectionString_ADOX, sTblLocalPrefix & sTblName
    Next i
    
'Отчёт о проделанной работе
    'Debug.Print String(74, "-")
    Debug.Print "Подключено: " & Format(i, "000") & " таблиц " & Now
    Debug.Print String(74, "-")
 
    
ReLinkTables_ADOX_Bye:
    On Error Resume Next
    'Обновляем список таблиц
    cat.Tables.Refresh
    
    cat.ActiveConnection.Close
    Set cat = Nothing
    Set tbl = Nothing
    
    'Keep_ADO_Connection
    Exit Sub 'Ура!!!
 
ReLinkTables_ADOX_Err:
    s = "Error " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
    "In procedure: ReLinkTables_ADOX in module: modCommon_ADOX"
    Debug.Print s
    MsgBox s, vbCritical, "Error in Application!"
    Err.Clear
    Resume ReLinkTables_ADOX_Bye
End Sub
Private Sub DelTable_ADOX(s$)
'Удаление подлинковки.
    On Error Resume Next
    cat.Tables.Delete s
    If Err = 0 Then Debug.Print s & " ... Deleted!"
    Err.Clear
End Sub
 
Private Sub LinkTable_ADOX(stRemTName As String, strConnect As String, Optional strLocalTableName As String = "")
'es 08.05.2017
'Подлинковка таблички MySQL Server с автоматическим созданием DSN (ADOX)
'Использует общие переменные данного модуля (так короче и возможно быстрее)
'-------------------------------------------------------------------------
'Аргументы:
'   stRemTName  = Имя таблицы на сервере
'   strConnect  = Строка подключения к серверу с "ODBC:DRIVER = ..."
'   strLocalTableName = Локальное Имя Таблицы
'-------------------------------------------------------------------------
 
On Err GoTo LinkTable_ADOX_Err
'Если локальное имя не указанно
    If strLocalTableName = "" Then strLocalTableName = stRemTName
    
     Set tbl = New ADOX.Table
 
'Установка параметров таблицы
    With tbl
        .Name = strLocalTableName
        Set .ParentCatalog = cat
        .Properties("Jet OLEDB:Link Provider String") = strConnect
        .Properties("Jet OLEDB:Remote Table Name") = stRemTName
        .Properties("Jet OLEDB:Create Link") = True
    End With
    
'Создаём новый обьект
    cat.Tables.Append tbl
    'cat.Tables.Refresh
    
LinkTable_ADOX_Bye:
    Exit Sub
 
LinkTable_ADOX_Err:
    'LinkTable_ADOX = Err.Number
    Debug.Print "Error " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
            "in Function: esLinkTable_ADOX"
    Resume LinkTable_ADOX_Bye
End Sub
  • Remove From My Forums
  • Question

  • Hi,
        When I add new feature(BI) for existing sql instance, error -2147467259 to me after about 70% installed.

    OS: Win7 enterprise IT support(64bit)
    VS:VS 2008 with SP1(can’t install SQL CLR)
    SQL server:Microsoft SQL Server 2008 (RTM) — 10.0.1600.22 (X64)   Jul  9 2008 14:17:44   Copyright (c) 1988-2008 Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

    Chief repro step:
    1.Install VS 2008 developer version
    2.Try install sql server without VS SP1, break
    3.Install SP1 for VS 2008
    4.Install all features for sql server 2008->change install folder->break
    5.Uninstall «sql server install support file» so that can reinstall sql server
    6.Install sql server 2008 with default path

    Error message displayed when installing BI

Answers

  • Hi,

    This problem due to Visual Studio 2008 is not installed in the default location so that SQL Server 2008 setup cannot find devenv.exe.config configuration file.

    Go to <Visual Studio installation folder>\Microsoft Visual Studio 9.0\Common7\IDE folder, find and copy devenv.exe.config file and paste it to the following folder (you may need to enable display extensions for known file types in folder options):

    For X64 Operating System:
    C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE

    For X86 Operating System:
    C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

    After pasting, re-run SQL Server 2008 setup, add BIDS feature to the existing instance of SQL Server 2008, it should install.


    Chunsong Feng
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

    • Marked as answer by

      Friday, January 22, 2010 8:01 AM

We recently encountered a bunch of problems with sp_send_dbmail, and they all returned this:

Failed to initialize sqlcmd library with error number -2147467259.

Super irritating, that error, because it seems to suggest that you’re doing something you’re not.
In fact, this error only indicates that there’s some generic problem sending mail with sp_send_dbmail.

Here are the problems we uncovered, and the troubleshooting steps for them.

1.  The SQL Server service account didn’t have sufficient privileges on the domain.

As a rule, we don’t allow our domain accounts to query the properties of other accounts.  This is true for service accounts, as well.  SQL, to do a fair number of things (not least to ensure the SQL Agent job owner is a valid domain member) requires the ability to query domain account properties.

We discovered this in troubleshooting:  when trying to use the

execute as user=

statement to make sure we didn’t have a problem with database permissions, we received this error:

Could not obtain information about Windows NT group/user...

Aha: domain permissions problem.  This was causing the «Failed to initialize sqlcmd library» error.
Granting the service account additional privileges on the domain fixed this problem.

2.  The executing user didn’t have sufficient privileges in the query database.

Having fixed the «execute as user» problem, we can now impersonate a DB user to execute the query in SSMS.  If you have sufficient permissions on the instance.  We’re assuming you have sysadmin access, here.

When we run the sp_send_dbmail, and the executing user doesn’t have permissions on the target database, we will see the «Failed to initialize sqlcmd library with error number -2147467259.» error.

We can uncover this is the problem by just executing the query portion of the sp_send_dbmail stored proc, and using the «execute as user=» statement beforehand.  Specify the SQL Agent service account user in this statement, and if the user doesn’t have permissions, you’ll get an error message that’s actually useful.

3.  The query is executing in the wrong database.

You actually see this pretty often, and the solution to this is most frequently listed possibility for fixing the «Failed to initialize sqlcmd library with error number -2147467259» error. 

The easiest solution to this problem is to specify the target database in sp_send_dbmail, like this:

EXEC msdb.dbo.sp_send_dbmail @recipients = @EmailList
       ,@execute_query_database = 'target_db_name'
       ,@subject = 'Subject'
       ,@body='Here's the body of the email'
       ,@query = @querytext
       ,@profile_name='email_profile'

I hope this helps; we spent far too long on tracking down #1 above.

Понравилась статья? Поделить с друзьями:

Интересное по теме:

  • Ошибка 214 tachosignal unplausibel
  • Ошибка 2147467259 hp как исправить
  • Ошибка 2147221164 класс не зарегистрирован аксиок
  • Ошибка 2138 субару
  • Ошибка 2147217900 не удалось выполнить sql запрос

  • Добавить комментарий

    ;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: