Selim
Aug 21, 2024 01:49 PM
Active user
Rating:
3
Joined: Sep 27, 2023
Company:
Hi Experts, i want to get data from external data source ExternalDataSources.XXXX.Tables.XXXX; how can i get all table data and iterate it, i tried like below but gives me error For Each DataRow In ExternalDataSources.XXX.Tables.XXXX Do EndDo;
Aleksandr Biryukov
Sep 18, 2024 02:29 PM
Administrator
Rating:
28
Joined: Oct 3, 2019
Company:
Hello Selim! None of the experts have answered you, so let me try to help you For first - could you provide a more complete code? And in general, it is better to work with external data sources using queries:
Code Query = New Query;
Query.Text =
"SELECT
| dbo_CURRENCIES.CODE AS CODE,
| dbo_CURRENCIES.NAME AS NAME,
| dbo_CURRENCIES.STATUS AS STATUS,
| dbo_CURRENCIES.EXTCODE AS EXTCODE
|FROM
| ExternalDataSource.RK_RKeeper7.Table.dbo_CURRENCIES AS dbo_CURRENCIES";
QueryResult = Query.Execute();
SelectionDetailRecords = QueryResult.Select();
While SelectionDetailRecords.Next() Do
// Insert selection processing SelectionDetailRecords
EndDo;
Peter Cross
Sep 23, 2024 10:41 PM
Active user
Rating:
8
Joined: May 21, 2023
Company:
And how do you connect to external data source?
Aleksandr Biryukov
Oct 09, 2024 12:40 PM
Administrator
Rating:
28
Joined: Oct 3, 2019
Company:
Hello Peter! How to connect to an external source - this is material for a small article... I have prepared several screenshots. I hope it will be clear to you how to connect. If you have any questions - ask!
Aleksandr Biryukov
Oct 09, 2024 12:42 PM
Administrator
Rating:
28
Joined: Oct 3, 2019
Company:
First we add an external source in the Designer:
Aleksandr Biryukov
Oct 09, 2024 12:45 PM
Administrator
Rating:
28
Joined: Oct 3, 2019
Company:
Select the tables whose data we want to work with. Also pay attention to screenshot 7 - it is necessary that the key field is filled in!
Aleksandr Biryukov
Oct 09, 2024 12:46 PM
Administrator
Rating:
28
Joined: Oct 3, 2019
Company:
Now we launch 1C in working mode and open the External Source there:
Aleksandr Biryukov
Oct 09, 2024 12:47 PM
Administrator
Rating:
28
Joined: Oct 3, 2019
Company:
There is one nuance here - when connecting for the first time, we need to specify the login and password again. Or the easiest way is to use the connection string, which can be copied from the Designer:
Aleksandr Biryukov
Oct 09, 2024 12:48 PM
Administrator
Rating:
28
Joined: Oct 3, 2019
Company:
After this, we can work with the data in the tables directly:
Selim
Oct 09, 2024 04:11 PM
Active user
Rating:
3
Joined: Sep 27, 2023
Company:
Thank you for your help. İs there another way to get all data from table without Query selection like below code For Each DataRow In ExternalDataSources.XXX.Tables.XXXX Do EndDo;
Aleksandr Biryukov
Oct 10, 2024 11:04 AM
Administrator
Rating:
28
Joined: Oct 3, 2019
Company:
As far as I know, the table of the external data source cannot be iterated, so this code:
Code For Each a In ExternalDataSources.ExternalDataSource1.Tables.HumanResources_Employee Do
EndDo;
won't work.
But I'll check with the developers. Thanks for the question!
Selim
Oct 10, 2024 01:33 PM
Active user
Rating:
3
Joined: Sep 27, 2023
Company:
Thank you for your help Sır
Subscribe