How to read data from another database?

Discussions about CSEntry
R.is
Posts: 14
Joined: February 7th, 2015, 4:54 am
Location: Tajikistan, Dushanbe

Re: How to read data from another database?

Post by R.is »

yes I have, he's added a screenshot can see.

Maybe I do not understand something or translator translates badly but I still do not understand what I do
Image
Last edited by R.is on April 29th, 2015, 10:54 am, edited 1 time in total.
josh
Posts: 2403
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: How to read data from another database?

Post by josh »

Why don't you use the pack tool to created a zip file of your application and post it as an attachment here so I can see what the problem is. It is hard to see the problem from just the screenshot.

What language are you translating from? I may be able to find someone who speaks it.
R.is
Posts: 14
Joined: February 7th, 2015, 4:54 am
Location: Tajikistan, Dushanbe

Re: How to read data from another database?

Post by R.is »

I translate it from Russian language
Thank you very much for the fact that despite the fact that I do not understand you continue to help me.

I repeat once again the problem

For example last year the survey was conducted by questionnaire diсt1 assume there was only one question:
What operating systems do you know?
and the first respondent said:
   Windows
   Mac os
   Linux
and now I need to hold a new poll in a year I go to the first respondent and tell him:
You said a year ago that you know the operating systems Windows, Mac os, Linux and which one is your best?
and response options should appear what he told us a year ago:
  Windows
  Mac os
  Linux

and select the best among them, in his view and record his response to diсt2
zip file https://drive.google.com/file/d/0B10br0 ... sp=sharing
josh
Posts: 2403
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: How to read data from another database?

Post by josh »

There are a number of problems with the application you sent. As I mentioned before, the arguments to the command loadcase must the be id-items for the external dictionary. In your application NAME, SEX and AGE are not id-items. They are regular data items therefore you cannot use them as keys for the lookup. Secondly you are using D1_DICT as the first argument to loadcase which is the name of the main dictionary and connot be used in loadcase which expects the name of an external dictionary.

I modified your application to use the ID item as the key for the lookup and moved it to the proc for the id item. Now when you enter the id, it loads the case from the second data file with the same id and fills in the name, sex and age fields.
PROC D1_ID

if loadcase(D2_DICT,D1_DICT.D1_ID) <> 1 THEN
    
errmsg("Failed to find case");
else
    D1_DICT.SEX = D2_DICT.SEX;
    D1_DICT.AGE = D2_DICT.AGE;
    D1_DICT.NAME = D2_DICT.NAME;
endif;
A working example is in the attached zip file. Enter 1 or 2 for the id item and it will fill in the other fields.
You do not have the required permissions to view the files attached to this post.
R.is
Posts: 14
Joined: February 7th, 2015, 4:54 am
Location: Tajikistan, Dushanbe

Re: How to read data from another database?

Post by R.is »

I could not open it you have posted
Image
josh
Posts: 2403
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: How to read data from another database?

Post by josh »

Please use CSPro 6.1 to open it.
R.is
Posts: 14
Joined: February 7th, 2015, 4:54 am
Location: Tajikistan, Dushanbe

Re: How to read data from another database?

Post by R.is »

Thank you for your response, I deal with it

but as I show all this in response options
Post Reply