Crmgo Blog

Connecting to another database via COM with managed forms

Connecting to another database via COM with managed forms

Regsvr32 "C:\Program Files (x86)\1cv82\8.2.19.83\bin\comcntr.dll" 1 Administration - Component Services - Computers - My Computer - COM+ Applications - Create Application - Create New Application - enter the name "V82.COMConnector" (switch "Server Application") - Specified User (Administrator) 2 In the created branch V82COMConnector –…

Connecting to another database via COM with managed forms

Regsvr32 "C:\Program Files (x86)\1cv82\8.2.19.83\bin\comcntr.dll"

1 Administration - Component Services - Computers - My Computer - COM+ Applications - Create New Application - Create New Application - enter the name "V82.COMConnector" (select "Server Application") - Specified User (Administrator)
2 In the created V82COMConnector branch - Components sub-branch - Create New Component - Install New Component - <1C directory>\bin\comcntr.dll
3 Right-click on the V82COMConnector branch - Properties - Security - Uncheck "Enforce access checks for applications" - Check "Apply software restriction policy" - Restriction Level "Unrestricted"

 

&НаСервере

Функция ПолучитьБазу() Экспорт
Попытка
Сервер = "lomix.com.ua";
ИмяБазы = "lomixDB";
Пользователь = "lomix_user";
Пароль = "*****";

v8 = Новый COMОбъект("V82.COMConnector");
СтрокаПодключения = "Srvr="""+СокрЛП(Сервер)+"""; Ref="""+ИмяБазы+"""; Usr="""+Пользователь+"""; Pwd="""+ Пароль +""""; 
База = v8.Connect(СтрокаПодключения);
Возврат База;
Исключение
Сообщить("Невозможно подключиться к базе");
КонецПопытки;

КонецФункции

 

 

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.

Categories: 1C