- Remove From My Forums
-
Question
-
I’m trying to write to database by Orchestrator and show the following error:
Write to database error has occurred. There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
Code = 80040e14
Code meaning = IDispatch error #3092
Source = Microsoft OLE DB Provider for SQL Server
Description = There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.The runbook execute 4 sql squery and write in database, when i put this sql query(below) its fail. (My database have 5 columms)
select
(select COUNT(ResourceID) as Total from v_R_System
where Resource_Domain_OR_Workgr0 in (my_domain) and Operating_System_Name_and0 not like ‘%Server%’)as ‘Total’,
(select COUNT(ResourceID) from v_R_System
where Resource_Domain_OR_Workgr0 in (my_domain) and Operating_System_Name_and0 not like ‘%Server%’
and Client0 = 1) as ‘Com’,
(select COUNT(ResourceID) from v_R_System
where Resource_Domain_OR_Workgr0 in (my_domain) and Operating_System_Name_and0 not like ‘%Server%’
and Client0 is null) as ‘Sem’
into #tmpselect
cast(convert(float,com)/(convert(float,com) + convert(float,sem))*100 as decimal(10,2)) as ‘Cliente YES’
from #tmpdrop table #tmp
Any ideas
Allan
Answers
-
Hi,
>>Code = 80040e14
To avoid this error, make sure that the number of values specified in the VALUES clause matches the number of columns specified in the INSERT INTO clause.
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
-
Proposed as answer by
Monday, May 9, 2016 6:14 AM
-
Marked as answer by
Xin GuoMicrosoft contingent staff
Tuesday, May 10, 2016 2:08 AM
-
Proposed as answer by
APAR status
-
Closed as program error.
Error description
-
When upgrading the existing project repository from AD 5.0.5.1 in AD 5.1 Build Client, IDispatch error #3092 is received as below: [2/8/2019 9:39AM] Upgrading the project repository... [2/8/2019 9:39AM] Upgrading the repository from version 8.7.78 to version 8.7.79. [2/8/2019 9:39AM] IDispatch error #3092
Local fix
-
na.
Problem summary
-
When trying o upgrade the repository from version 8.7.78 to 8.7.79 the following error occurs: "IDispatch error 3092".
Problem conclusion
-
An SQL phrase with an unsupported syntax on SQL Server 2012 or bellow, was executed. Fixed by code changes.
Temporary fix
Comments
APAR Information
-
APAR number
PH08500
-
Reported component name
APPL DISCOVERY
-
Reported component ID
5737B1600
-
Reported release
510
-
Status
CLOSED PER
-
PE
NoPE
-
HIPER
NoHIPER
-
Special Attention
NoSpecatt / Xsystem
-
Submitted date
2019-02-12
-
Closed date
2019-02-13
-
Last modified date
2019-02-13
-
APAR is sysrouted FROM one or more of the following:
-
APAR is sysrouted TO one or more of the following:
Fix information
-
Fixed component name
APPL DISCOVERY
-
Fixed component ID
5737B1600
Applicable component levels
[{«Business Unit»:{«code»:»BU058″,»label»:»IBM Infrastructure w/TPS»},»Product»:{«code»:»SSRR9Q»,»label»:»IBM Application Discovery for IBM Z»},»Component»:»»,»ARM Category»:[],»Platform»:[{«code»:»PF025″,»label»:»Platform Independent»}],»Version»:»510″,»Edition»:»»,»Line of Business»:{«code»:»LOB35″,»label»:»Mainframe SW»}}]
Choose your language for a machine translation:
-
Created by Jules, last modified on Feb 28, 2014
Summary
When opening a file in ArtiosCAD, the following error appears:
[Microsoft][ODBC SQL Server Driver][SQL Server]A column has been specified more than once in the order by list. Columns in the order by list must be unique.;IDispatch error #3092.
Symptoms
It is possible to open the file to edit, but is not possible to save back to the database. The error message will appear whenever opening and closing a design that is stored in the database.
Solution
Run a repair of ArtiosCAD using the software media that was provided on DVD or downloaded from mysoftware.esko.com
- Select
setup.exe
- Select Modify ArtiosCAD (version is applicable to specific case).
- Select Repair and click Next. This may take a few moments.
- Click Install.
- The installation may take a while.
- You will see some status bar activity and a command prompt window towards the end of the installation which is running the Database scripts repairing the 3092 error.
- Once you see this dialog click Finish and start ArtiosCAD. Open a file and confirm that the error is gone.
Article information | |
---|---|
Applies to |
ArtiosCAD Standard Edition using SQL database |
Created | 06-Feb-14 |
Last revised | |
Author | PACO |
CW Number |
Overview
Content Tools
ThemeBuilder
Tasks
Bookmarks
- artioscad
- sql
- 3092
- idispatch
- 81497400
- chra
- error
- troubleshooting
- screenshot
- kb-published
Re[2]: Проблема с ADO Command
|
От: |
MaximE |
|
Дата: | 10.11.02 09:17 | ||
Оценка: |
8 (1) |
Здравствуйте Алекс, Вы писали:
А>Здравствуйте Xenia, Вы писали:
А>[]
А>Вместо
А>
m_command->>ActiveConnection = m_cnn;
А>
А>нужно писать
А>
m_command->>ActiveConnection = _variant_t((IDispatch*)m_сnn);
А>
А>или что-то в этом духе.
Нет. В данном случае имеем:
__declspec(property(get=GetActiveConnection,put=PutRefActiveConnection))
_ConnectionPtr ActiveConnection;
_ConnectionPtr GetActiveConnection();
void PutRefActiveConnection (struct _Connection * ppvObject);
Re[5]: Проблема с ADO Command
|
От: |
Amba |
|
Дата: | 10.11.02 13:52 | ||
Оценка: |
6 (1) |
Здравствуйте MaximE&Xenia, Вы писали:
Можно попытаться переписать так:
m_spCommand->PutActiveConnection(m_spConnection.GetInterfacePtr());
....
потом
m_spCommand->Execute(NULL, NULL, adCmdText);
хотя чтобы избежать таких проблем логичнее сразу выполнить запрос с использованием текущего соединения (если у тебя просто текст запроса)
с командами же удобнее работать когда передаешь сохраненным процедурам какие-то параметры, хотя это конечно дело вкуса.
а если ошибки какие в процессе, то удобнее смотреть так:
_bstr_t bstrDescr;
_bstr_t bstrErrMessage(e.ErrorMessage());
_bstr_t bstrErrSource(e.Source());
_bstr_t bstrErrDescription(e.Description());
if(bstrErrSource.length() != NULL && bstrErrDescription.length() != NULL)
{
bstrDescr += "nSource: ";
bstrDescr += (BSTR)bstrErrSource;
bstrDescr += "nDescription: ";
bstrDescr += (BSTR)bstrErrDescription;(LPCSTR)e.Description());
}
|
От: |
Xenia |
|
Дата: | 09.11.02 14:35 | ||
Оценка: |
Здравствуйте!
Имееся такой код:
try{
m_command->ActiveConnection = m_cnn;
m_command->CommandText = "insert into accbase(rn,account,name_acc) values('0002','010','ffff')";
_variant_t pRecordsAffected;
_variant_t vtOpt((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
m_command->Execute(&pRecordsAffected,&vtOpt,adCmdText);
}
catch(_com_error e)
{
AfxMessageBox(e.ErrorMessage());
}
Получаю сообщение IDispatch Error #3092
В чем тут моет быть проблема?
Re: Проблема с ADO Command
|
От: |
AndreyT |
|
Дата: | 09.11.02 18:16 | ||
Оценка: |
Здравствуйте Xenia, Вы писали:
X>Здравствуйте!
X>Имееся такой код:
X>
X>try{
X> m_command->ActiveConnection = m_cnn;
X> m_command->CommandText = "insert into accbase(rn,account,name_acc) values('0002','010','ffff')";
X> _variant_t pRecordsAffected;
X> _variant_t vtOpt((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
X> m_command->Execute(&pRecordsAffected,&vtOpt,adCmdText);
X>}
X>catch(_com_error e)
X>{
X> AfxMessageBox(e.ErrorMessage());
X>}
X>
X>Получаю сообщение IDispatch Error #3092
X>В чем тут моет быть проблема?
Если вам не нужно возвращать records affected, то можно обойтись без этого параметра.
...
m_command->Execute(&pRecordsAffected,NULL,adCmdText);
...
Re: Проблема с ADO Command
|
От: |
MaximE |
|
Дата: | 09.11.02 18:23 | ||
Оценка: |
Здравствуйте Xenia, Вы писали:
X>Получаю сообщение IDispatch Error #3092
X>В чем тут моет быть проблема?
А какая строка кидает исключение?
Re[2]: Проблема с ADO Command
|
От: |
AndreyT |
|
Дата: | 09.11.02 18:32 | ||
Оценка: |
Здравствуйте AndreyT, Вы писали:
AT>Здравствуйте Xenia, Вы писали:
X>>Здравствуйте!
X>>Имееся такой код:
X>>
X>>try{
X>> m_command->ActiveConnection = m_cnn;
X>> m_command->CommandText = "insert into accbase(rn,account,name_acc) values('0002','010','ffff')";
X>> _variant_t pRecordsAffected;
X>> _variant_t vtOpt((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
X>> m_command->Execute(&pRecordsAffected,&vtOpt,adCmdText);
X>>}
X>>catch(_com_error e)
X>>{
X>> AfxMessageBox(e.ErrorMessage());
X>>}
X>>
X>>Получаю сообщение IDispatch Error #3092
X>>В чем тут моет быть проблема?
AT>Если вам не нужно возвращать records affected, то можно обойтись без этого параметра.
AT>
AT>...
AT> m_command->Execute(&pRecordsAffected,NULL,adCmdText);
AT>...
AT>
Пардон. зарапортовался
на самом деле хотел написать вот что
...
m_command->Execute(NULL,NULL,adCmdText);
...
Re: Проблема с ADO Command
|
От: |
Алекс |
http://wise-orm.com |
Дата: | 10.11.02 08:52 | ||
Оценка: |
Здравствуйте Xenia, Вы писали:
[]
Вместо
m_command->ActiveConnection = m_cnn;
нужно писать
m_command->ActiveConnection = _variant_t((IDispatch*)m_сnn);
или что-то в этом духе.
Re[2]: Проблема с ADO Command
|
От: |
Xenia |
|
Дата: | 10.11.02 13:04 | ||
Оценка: |
Здравствуйте MaximE, Вы писали:
ME>А какая строка кидает исключение?
строка
_command->Execute(&pRecordsAffected,&vtOpt,adCmdText);
Интересно и то, что тот же код переписанный на VB работает отлично…
Re[3]: Проблема с ADO Command
|
От: |
Xenia |
|
Дата: | 10.11.02 13:12 | ||
Оценка: |
Здравствуйте AndreyT, Вы писали:
AT>на самом деле хотел написать вот что
AT>
AT>...
AT> m_command->Execute(NULL,NULL,adCmdText);
AT>...
AT>
Вот тут было высказано другое мнение
http://www.rsdn.ru/Forum/Message.aspx?mid=12065&only=1
Автор: Lexey
Дата: 13.11.01
Re[3]: Проблема с ADO Command
|
От: |
MaximE |
|
Дата: | 10.11.02 13:30 | ||
Оценка: |
Здравствуйте Xenia, Вы писали:
X>Здравствуйте MaximE, Вы писали:
X>
ME>>А какая строка кидает исключение?
X>строка
X>
_command->>Execute(&pRecordsAffected,&vtOpt,adCmdText);
X>
X>Интересно и то, что тот же код переписанный на VB работает отлично…
Попробуй написать так:
_command->Execute(&vtMissing, &vtMissing, adCmdText);
Re[4]: Проблема с ADO Command
|
От: |
MaximE |
|
Дата: | 10.11.02 13:34 | ||
Оценка: |
Здравствуйте MaximE, Вы писали:
ME>Попробуй написать так:
ME>
_command->>Execute(&vtMissing, &vtMissing, adCmdText);
ME>
Если это не заработает, то покажи рабочий код на VB.
Re[6]: Проблема с ADO Command
|
От: |
Xenia |
|
Дата: | 10.11.02 14:41 | ||
Оценка: |
Всем спасибо за помощь, разобралась.
Там вся проблема была в самой базе — нарушалась уникальность одного из индексов.Сегодня на свежую голову сразу это увидела, а вчера видимо переработала
Re[4]: Проблема с ADO Command
|
От: |
AndreyT |
|
Дата: | 10.11.02 14:41 | ||
Оценка: |
Здравствуйте Xenia, Вы писали:
X>Здравствуйте AndreyT, Вы писали:
AT>>на самом деле хотел написать вот что
AT>>
AT>>...
AT>> m_command->Execute(NULL,NULL,adCmdText);
AT>>...
AT>>
X>Вот тут было высказано другое мнение
X>http://www.rsdn.ru/Forum/Message.aspx?mid=12065&only=1
Автор: Lexey
Дата: 13.11.01
А я и не против разных мнений.
Я говорил про свой опыт. У меня передача нулей в качестве двух первых аргументов всегда работала.
С версиями ADO начиная с 2.0. В программах на C, в VBA я не спец.
А вот при попытке заполнять их всякой ничего не значащей фигней были проблемы.
- Переместить
- Удалить
- Выделить ветку
Пока на собственное сообщение не было ответов, его можно удалить.
Advanced Troubleshooting
Review log files to identify the issue
To investigate why SQL log truncation has failed, the Veeam logs will need to be reviewed to determine which part of the truncation procedure failed.
For Veeam Backup & Replication, the log file containing information about the truncation procedure will be found on the SQL server, and is named:
C:ProgramDataVeeamBackupVeeamGuestHelper_ddmmyyyy.log
Within the VeeamGuestHelper log file, beneath the line «Transaction log truncation statistics,» you will see information about which account was used, which SQL instances were processed, and a list of each database that was interacted with.
VeeamGuestHelper Log Example
In this example, the account domainbkpadmin does not have permissions within the SQL Instance.
For Veeam Agent for Microsoft Windows, the log file containing truncation details will be found on the SQL server in:
C:ProgramDataVeeamEndpoint<jobname>Job.Backup.log
Within the Job.Backup.log log file, beneath the line «Checking if can truncate SQL logs.» you will see information about which account was used, which SQL instances were processed, and a list of each database that was interacted with.
Job.Backup.log Example
In this example, the account domainbkpadmin does not have permissions within the SQL Instance.
Known Errors and Solutions
Below is a list of commonly observed errors found in the logs and solutions to each.
The user listed in the error cannot connect to the SQL Instance, as it does not have the required SQL permissions.
This specific error means that the account in the error isn’t listed in the «Logins» section of the SQL Instance, and therefore has no right to login to the SQL Instance. To resolve this, create a login for the account within the SQL Instance on the machine that is failing to truncate, and assign it the sysadmin role.
Note: You will need to launch SQL Management Studio using an account other than the one in the error, as that account will not have permission to connect to the SQL Instance.
The user listed in the error is able to log in to the SQL Instance but lacks the required SQL permissions to interact with the databases.
To resolve this, connect to the SQL Instance of the machine that is failing to truncate, and edit the login entry ( Security > Logins ), and assign the sysadmin role.
Note: You will need to launch SQL Management Studio using an account other than the one in the error, as that account will not have sufficient permissions to assign itself the sysadmin role.
This issue is often seen on the secondary node of a SQL Server AlwaysOn cluster. This issue can be solved by manually creating a backup of the database mentioned in the error using SQL Server Management Studio. Alternatively, you can set the secondary node as primary for just one backup job run. As a result, all databases on that node will be backed up without the «copy only» flag, and the error will dissipate.
The issue occurs when the secondary node has always been backed up with the «copy only» flag, and its standalone DBs do not have a full backup. Thus during the truncation of the standalone DB logs, this error occurs.
The same solution applies if you get this message about the excluded vCenter or Veeam database.
This message means that the truncation process could not be completed within the default execution timeout.
It is possible to increase the execution timeout. However, the registry value and placement depend on the SQL backup job’s configuration. See below:
For a VM being backed up by Veeam Backup & Replication
The following registry value can be created on the SQL server having the issue and adjusted to change the SQL task execution timeout (default 300 seconds).
Key Location: HKLMSOFTWAREVeeamVeeam Backup and Replication
Value Name: SqlExecTimeout
Value Type: DWORD (32-Bit) Value
Default Value Data: 300 (Decimal)
The value is in seconds. Increase the value and rerun the job. The value needed will be unique to each environment.
A common tactic is to increase the value by 300, test the job, and increase by another 300 seconds if it fails.
For a machine backed up using Veeam Agent for Microsoft Windows *except Failover Cluster job type
This registry value may be used for all jobs involving Veeam Agent for Microsoft Windows, except Failover Cluster type jobs.
The following registry value can be created on the SQL server having the issue and adjusted to change the SQL task execution timeout (default 300 seconds).
Key Location: HKLMSOFTWAREVeeamVeeam Endpoint Backup
Value Name: SqlExecTimeout
Value Type: DWORD (32-Bit) Value
Default Value Data: 300 (Decimal)
The value is in seconds. Increase the value and rerun the job. The value needed will be unique to each environment.
A common tactic is to increase the value by 300, test the job, and increase by another 300 seconds if it fails.
For a SQL Failover Cluster that is backed up using Failover Cluster job within Veeam Backup & Replication
This scenario is specific to when a Veeam Agent for Microsoft Windows backup is managed by Veeam Backup & Replication, and the Job Mode is set to Failover cluster type.
To implement this SQL task execution timeout, the following registry value must be created on all nodes of the SQL Failover cluster.
Key Location: HKLMSOFTWAREVeeamVeeam Backup and Replication
Value Name: SqlExecTimeout
Value Type: DWORD (32-Bit) Value
Default Value Data: 300 (Decimal)
The value is in seconds. Increase the value and rerun the job. The value needed will be unique to each environment.
A common tactic is to increase the value by 300, test the job, and increase it by another 300 seconds if it fails.
To submit feedback regarding this article, please click this link: Send Article Feedback
To report a typo on this page, highlight the typo with your mouse and press CTRL + Enter.
Содержание
- Python-сообщество
- Уведомления
- #1 Сен. 14, 2016 12:26:28
- Не удаётся подключиться к COM объекту
- #2 Сен. 23, 2016 07:47:23
- Не удаётся подключиться к COM объекту
- #3 Сен. 23, 2016 08:00:13
- Не удаётся подключиться к COM объекту
- #4 Сен. 23, 2016 08:11:39
- Не удаётся подключиться к COM объекту
- #5 Сен. 23, 2016 08:23:11
- Не удаётся подключиться к COM объекту
- #6 Сен. 23, 2016 08:46:18
- Не удаётся подключиться к COM объекту
- #7 Сен. 23, 2016 09:03:11
- Не удаётся подключиться к COM объекту
- #8 Сен. 23, 2016 09:10:20
- Не удаётся подключиться к COM объекту
- #9 Сен. 23, 2016 09:12:15
- Не удаётся подключиться к COM объекту
- #10 Сен. 23, 2016 09:18:37
- Не удаётся подключиться к COM объекту
- Com error idispatch error
- Asked by:
- Question
- All replies
- Structure of COM Error Codes
- Com error idispatch error
Python-сообщество
Уведомления
#1 Сен. 14, 2016 12:26:28
Не удаётся подключиться к COM объекту
Пишу программу на Python,
Windows 7 Профессиональная 64bit
Запускаю, после чего, он на меня так ругается:
Регистрировал компонент так:
Регистрация прошла успешно
Почему он не зарегистрирован?
VBA excel без проблем к нему коннектится
#2 Сен. 23, 2016 07:47:23
Не удаётся подключиться к COM объекту
Подскажите хотя бы, что значит для питоновской библиотеки win32com, что класс не зарегистрирован?
Где должна в реестре быть запись о классе, что бы он так сказать прошёл регистрацию?
Отредактировано andman (Сен. 23, 2016 07:48:37)
#3 Сен. 23, 2016 08:00:13
Не удаётся подключиться к COM объекту
А у меня встречный вопрос. Интересно важно какая у вас архитектура? Питон у вас x64 а batchx.dll вроде как 32. Я помнится давным давно когда через opc общался с различными штуками из питона, боролся с этим. Может в этом дело? Не спец по com так что не судите строго.
p.s.
Мой опыт общения с com показал что это крайне неудобный и медленный способ организации связи с приложениями. Поэтому наверное тут никто вам и не отвечает. COM это последнее что будут использовать питон программисты 🙂
Отредактировано doza_and (Сен. 23, 2016 08:03:20)
#4 Сен. 23, 2016 08:11:39
Не удаётся подключиться к COM объекту
doza_and
А у меня встречный вопрос. Интересно важно какая у вас архитектура? Питон у вас x64 а batchx.dll вроде как 32. Я помнится давным давно когда через opc общался с различными штуками из питона, боролся с этим. Может в этом дело? Не спец по com так что не судите строго.p.s. Мой опыт общения с com показал что это крайне неудобный и медленный способ организации связи с приложениями. Поэтому наверное тут никто вам и не отвечает. COM это последнее что будут использовать питон программисты
Не совсем понял, на счёт архитектуры, то что я указал win7 64 bit, это не то?
Кстати пробовал я и питон 32 бит — всё тоже самое.
А на счёт СОМ, у меня выбора особо то и нет. У меня есть среда разработки STEP7(на которой мне нужно создать конечный програмный продукт), которая умеет общаться только через СОМ.
Отредактировано andman (Сен. 23, 2016 08:13:15)
#5 Сен. 23, 2016 08:23:11
Не удаётся подключиться к COM объекту
p.s.
Мой опыт общения с com показал что это крайне неудобный и медленный способ организации связи с приложениями. Поэтому наверное тут никто вам и не отвечает. COM это последнее что будут использовать питон программисты
Зато до чертиков универсальный и разжеванный и довольно много девайсов работает по нему- потому я не был бы так категоричен.
Весьма не просто разобраться в вашей проблеме не имея нужных данных
Однако, сколько я уже топиков перечитал в своей жизни на разных ресурсах — везде где есть слово win32….. пожизненный рак.
И не пишите сразу весь код — для начала сделайте простой запрос ответ — убедитесь что есть связь! А вот дальше уже можно думать
Влодение рускай арфаграфией — это как владение кунг-фу: настаящие мастира не преминяют ево бес ниабхадимости
#6 Сен. 23, 2016 08:46:18
Не удаётся подключиться к COM объекту
Вы наверное меня неправильно поняли.
COM — Component Object Model, а не последовательные порт
Опишу суть того, что я делаю, и что мне надо.
Я занимаюсь программированием промышленных контроллеров, в частности Siemens S7-300/400.
Среда разработки для этих контроллеров является STEP7 (https://ru.wikipedia.org/wiki/Simatic_Step_7)
Каждый раз писать программу для контроллера вручную — просто лень, так как структура программы практически одна и таже. На текущий момент, я делаю так: структурирую нужным мне образом данные тех-задания в excel таблицу, далее эту таблицу обрабатываю с помощью VBA, генерю тем самым исходники для step7, с помощью СОМ вставляю их прямо в среду разработки STEP7, так же с помощью СОМ компилю их и — профит!
Но сами понимаете, VBA по сравнению с python, это как сравнивать запорожец с мерседесом.
Устал я от VBA, вот и хочу переписать свой “автоген”, как я его называю, на python`e
Исходники конечно можно вставлять и вручную(копипаст), но их бывает достаточно много и делать приходится это довольно часто, получится это довольно геморно, поэтому нужно делать это автоматически.
Пока не победил я этом камень преткновения: почему VBA без проблем работает с СОМ объектом Simatic.Simatic, а python испытывает проблему незарегистрированного класса.
Отредактировано andman (Сен. 23, 2016 09:05:27)
#7 Сен. 23, 2016 09:03:11
Не удаётся подключиться к COM объекту
Да тут вы правы! Я не понял при чем тут реализация задачи общения по ком порту на питоне и автоматизация с екселем. Кроме того никто не запрещает вам использовать вин32 для других задач!
На данный момент я предложил попробовать просто связаться с вашим устройством посредством pyserial
что бы локализовать вашу проблему
Влодение рускай арфаграфией — это как владение кунг-фу: настаящие мастира не преминяют ево бес ниабхадимости
#8 Сен. 23, 2016 09:10:20
Не удаётся подключиться к COM объекту
ZerG
Да тут вы правы! Я не понял при чем тут реализация задачи общения по ком порту на питоне и автоматизация с екселем. Кроме того никто не запрещает вам использовать вин32 для других задач! На данный момент я предложил попробовать просто связаться с вашим устройством посредством pyserial что бы локализовать вашу проблему
Дак у меня нет никакого устройства, есть СОМ-объект, до которого я не могу достучаться на python.
Pyserial работает с последовательным портом и выполняет совсем другие задачи, или я не прав?
#9 Сен. 23, 2016 09:12:15
Не удаётся подключиться к COM объекту
Вот теперь наконец-то понял.
Сдедайте скрины на ком обьект с его названиями и свойствами
Влодение рускай арфаграфией — это как владение кунг-фу: настаящие мастира не преминяют ево бес ниабхадимости
#10 Сен. 23, 2016 09:18:37
Не удаётся подключиться к COM объекту
ZerG
Вот теперь наконец-то понял. Сдедайте скрины на ком обьект с его названиями и свойствами
В самом начале темы в первом сообщении 2 скрина моего COM-объекта Simatic, или надо какие то другие скрины?
Отредактировано andman (Сен. 23, 2016 09:19:16)
Источник
Asked by:
Question
Really appreciate any help!!
This is what I get when I try to run a program:
Caught COM error in file C:BOSSComonBusinessServicesCashControlAdoDataAccess.cpp at line 615:
Code meaning=IDispatch error #3092
Source=Microsoft OLE DB Provider for ODBC Drivers
Description=[Microsoft][ODBC SQL Server Driver][SQL Server]Database «msdb» cannot be opened because some of the files could not be actvided.
Windows 2000 profesional server
First of all, you need to check whether the code is written correctly. Secondly the error code 80040e14 and IDispatch error #3092 always occur when you have a syntax error in your sql query string. So you need to ensure it also have enough permission to achieve this.
Thirdly, you need to ensure both authenticated user and Application pool identity have enough permission to access the cpp. Besides, you need to ensure app pool identity have enough permission to access the sql database.
Источник
The following illustration shows the format of an HRESULT (or SCODE); the numbers indicate bit positions:
The high-order bit in the HRESULT or SCODE indicates whether the return value represents success or failure. If set to 0, SEVERITY_SUCCESS, the value indicates success. If set to 1, SEVERITY_ERROR, it indicates failure.
The R, C, N, and r bits are reserved.
The facility field indicates the system service responsible for the error. Microsoft allocates new facility codes as they become necessary. Most SCODEs and HRESULT values set the facility field to FACILITY_ITF, indicating an interface method error.
Common facility fields are described in the following table.
Facility Field | Value | Description |
---|---|---|
FACILITY_DISPATCH | 2 | For late-binding IDispatch interface errors. |
FACILITY_ITF | 4 | For most status codes returned from interface methods. The actual meaning of the error is defined by the interface. That is, two HRESULTs with exactly the same 32-bit value returned from two different interfaces might have different meanings. |
FACILITY_NULL | For broadly applicable common status codes such as S_OK. | |
FACILITY_RPC | 1 | For status codes returned from remote procedure calls. |
FACILITY_STORAGE | 3 | For status codes returned from IStorage or IStream method calls relating to structured storage. Status codes whose code (lower 16 bits) value is in the range of MS-DOS error codes (that is, less than 256) have the same meaning as the corresponding MS-DOS error. |
FACILITY_WIN32 | 7 | Used to provide a means of handling error codes from functions in the Windows API as an HRESULT. Error codes in 16-bit OLE that duplicated system error codes have also been changed to FACILITY_WIN32. |
FACILITY_WINDOWS | 8 | Used for additional error codes from Microsoft-defined interfaces. |
The code field is a unique number that is assigned to represent the error or warning.
By convention, HRESULT values generally have names in the following format: Facility_Severity_Reason.
Facility is either the facility name or some other distinguishing identifier; Severity is a single letter, S or E, that indicates whether the function call succeeded (S) or produced an error (E); and Reason is an identifier that describes the meaning of the code. For example, the status code STG_E_FILENOTFOUND indicates a storage-related error has occurred; specifically, a requested file does not exist. Status codes from FACILITY_NULL omit the Facility_ prefix.
Error codes are defined within the context of an interface implementation. Once defined, success codes cannot be changed or new success codes added. However, new failure codes can be written. Microsoft reserves the right to define new failure codes (but not success codes) for the interfaces described in FACILITY_ITF or in new facilities.
Источник
Здравствуйте Алекс, Вы писали:
А>Здравствуйте Xenia, Вы писали:
А>[]
А>Вместо
А>
А>нужно писать
А>
А>или что-то в этом духе.
Нет. В данном случае имеем:
|
От: | Amba |
Дата: | 10.11.02 13:52 | |
Оценка: | 6 (1) |
Здравствуйте MaximE&Xenia, Вы писали:
Можно попытаться переписать так:
потом
m_spCommand->Execute(NULL, NULL, adCmdText);
хотя чтобы избежать таких проблем логичнее сразу выполнить запрос с использованием текущего соединения (если у тебя просто текст запроса)
с командами же удобнее работать когда передаешь сохраненным процедурам какие-то параметры, хотя это конечно дело вкуса.
а если ошибки какие в процессе, то удобнее смотреть так:
|
От: | Xenia |
Дата: | 09.11.02 14:35 | |
Оценка: |
Здравствуйте!
Имееся такой код:
Получаю сообщение IDispatch Error #3092
В чем тут моет быть проблема?
|
От: | AndreyT |
Дата: | 09.11.02 18:16 | |
Оценка: |
Здравствуйте Xenia, Вы писали:
X>Здравствуйте!
X>Имееся такой код:
X>
X>Получаю сообщение IDispatch Error #3092
X>В чем тут моет быть проблема?
Если вам не нужно возвращать records affected, то можно обойтись без этого параметра.
|
От: | MaximE |
Дата: | 09.11.02 18:23 | |
Оценка: |
Здравствуйте Xenia, Вы писали:
X>Получаю сообщение IDispatch Error #3092
X>В чем тут моет быть проблема?
А какая строка кидает исключение?
|
От: | AndreyT |
Дата: | 09.11.02 18:32 | |
Оценка: |
Здравствуйте AndreyT, Вы писали:
AT>Здравствуйте Xenia, Вы писали:
X>>Здравствуйте!
X>>Имееся такой код:
X>>
X>>Получаю сообщение IDispatch Error #3092
X>>В чем тут моет быть проблема?
AT>Если вам не нужно возвращать records affected, то можно обойтись без этого параметра.
AT>
на самом деле хотел написать вот что
|
От: | Алекс | http://wise-orm.com |
Дата: | 10.11.02 08:52 | ||
Оценка: |
Здравствуйте Xenia, Вы писали:
или что-то в этом духе.
|
От: | Xenia |
Дата: | 10.11.02 13:04 | |
Оценка: |
Здравствуйте MaximE, Вы писали:
ME>А какая строка кидает исключение?
строка
Интересно и то, что тот же код переписанный на VB работает отлично.
|
От: | Xenia |
Дата: | 10.11.02 13:12 | |
Оценка: |
Здравствуйте AndreyT, Вы писали:
AT>на самом деле хотел написать вот что
AT>
|
От: | MaximE |
Дата: | 10.11.02 13:30 | |
Оценка: |
Здравствуйте Xenia, Вы писали:
X>Здравствуйте MaximE, Вы писали:
X>
ME>>А какая строка кидает исключение?
X>строка
X>
X>Интересно и то, что тот же код переписанный на VB работает отлично.
Попробуй написать так:
|
От: | MaximE |
Дата: | 10.11.02 13:34 | |
Оценка: |
Здравствуйте MaximE, Вы писали:
ME>Попробуй написать так:
ME>
Если это не заработает, то покажи рабочий код на VB.
|
От: | Xenia |
Дата: | 10.11.02 14:41 | |
Оценка: |
|
От: | AndreyT |
Дата: | 10.11.02 14:41 | |
Оценка: |
А я и не против разных мнений.
Я говорил про свой опыт. У меня передача нулей в качестве двух первых аргументов всегда работала.
С версиями ADO начиная с 2.0. В программах на C, в VBA я не спец.
А вот при попытке заполнять их всякой ничего не значащей фигней были проблемы.
Источник