123456
asked on
DBNAVIGATOR (enter data without enter ID for this data )
hi experts,
I have three tables
1-article(Aid,description, title,abst ract,locat ion); AID=P.K relation:
2-keywordarticle( AID,keywordID) ; aid+keyword=p.k , aid=f.k,keywordID =f.k article M:N keyword
3-keyword(keywordID,keywor dname); keywordid:p.k
when a user enter data as keywords in DBnavigator don’t need to enter keywordID only enter keywordname and
if keyword not exist in keyword table create a another keywordid dynamically and add this keywordid to keywordarticle table also.
If exist this keyword in the keyword table only add this keywordid to keywordarticle table.
Is this probable, if probable any one can help me in solving this problem?
Thanks in advance
Hamid reza.
I have three tables
1-article(Aid,description,
2-keywordarticle( AID,keywordID) ; aid+keyword=p.k , aid=f.k,keywordID =f.k article M:N keyword
3-keyword(keywordID,keywor
when a user enter data as keywords in DBnavigator don’t need to enter keywordID only enter keywordname and
if keyword not exist in keyword table create a another keywordid dynamically and add this keywordid to keywordarticle table also.
If exist this keyword in the keyword table only add this keywordid to keywordarticle table.
Is this probable, if probable any one can help me in solving this problem?
Thanks in advance
Hamid reza.
ASKER
My database is access 2000
My adoconnection is ADO.
My adoconnection is ADO.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
btw. if you leave your eMail,
then i could send you this sample project
meikl ;-)
then i could send you this sample project
meikl ;-)
ASKER
thanks, if probable
send this to hr_1357@yahoo.com
send this to hr_1357@yahoo.com
sample on the way ;-)
ASKER
thanks i recieved your mail
please read the last of my comment in ( master-detail question)
your experience is so high in writing sql,
if you read the first comments of LUKA you found that his skill in writing sql is not so high(sorry i tell it).
thanks again.
hamid reza
please read the last of my comment in ( master-detail question)
your experience is so high in writing sql,
if you read the first comments of LUKA you found that his skill in writing sql is not so high(sorry i tell it).
thanks again.
hamid reza
ASKER
Hi again meiki,
This section is not work properly , for it test a same word. I cant find it but why ?
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig ned(AArtic leID, AKeyWordID : Integer) : Boolean;
begin
result := not ADOTableKeyWordArticle.Loc ate('AID;K eyWordId', VarArrayOf ([AArticle ID,AKeyWor dID]),[]);
end;
This section is not work properly , for it test a same word. I cant find it but why ?
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig
begin
result := not ADOTableKeyWordArticle.Loc
end;
ASKER
Hi again meiki,
This section is not work properly , for it test a same word. I cant find it but why ?
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig ned(AArtic leID, AKeyWordID : Integer) : Boolean;
begin
result := not ADOTableKeyWordArticle.Loc ate('AID;K eyWordId', VarArrayOf ([AArticle ID,AKeyWor dID]),[]);
end;
This section is not work properly , for it test a same word. I cant find it but why ?
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig
begin
result := not ADOTableKeyWordArticle.Loc
end;
ASKER
Hi again meiki,
This section is not work properly , for it test a same word. I cant find it but why ?
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig ned(AArtic leID, AKeyWordID : Integer) : Boolean;
begin
result := not ADOTableKeyWordArticle.Loc ate('AID;K eyWordId', VarArrayOf ([AArticle ID,AKeyWor dID]),[]);
end;
This section is not work properly , for it test a same word. I cant find it but why ?
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig
begin
result := not ADOTableKeyWordArticle.Loc
end;
? what did not work properly
is there already the same keyword assigned to the article,
and its creates a new one or do it try to insert a new
relation, which already exists?
meikl ;-)
is there already the same keyword assigned to the article,
and its creates a new one or do it try to insert a new
relation, which already exists?
meikl ;-)
ASKER
if you enter a same keyword that exist in special article dont work propely as you want.
and get error when insert to keywordarticle table with database.
because in my mind this if dont work properly:
if KeyWordIDisNotAssigned(ADO TableArtic le.FieldBy Name('AID' ).AsIntege r, KeyWordID) then
m.reza
and get error when insert to keywordarticle table with database.
because in my mind this if dont work properly:
if KeyWordIDisNotAssigned(ADO
m.reza
not noticed this (works properly for me),
are you sure that you forward the right IDs?
are you sure that you forward the right IDs?
ASKER
please see my sql request in master-detail question.
ASKER
I enter in two times these words for a same article
Salam
But in second time get error with database not with your
raise Exception.Create('Keyword is already assigned to this Article!');
I don’t understand because everything is right.
I test this program with step to step I found that the result of this section in my computer every time is true .
For it get error with databases on second word.
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig ned(AArtic leID, AKeyWordID : Integer) : Boolean;
begin
result := not ADOTableKeyWordArticle.Loc ate('AID;K eyWordId', VarArrayOf ([AArticle ID,AKeyWor dID]),[]);
end;
Why!?
Say that my OS is win98A . and ado version is 2.7?
Salam
But in second time get error with database not with your
raise Exception.Create('Keyword is already assigned to this Article!');
I don’t understand because everything is right.
I test this program with step to step I found that the result of this section in my computer every time is true .
For it get error with databases on second word.
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig
begin
result := not ADOTableKeyWordArticle.Loc
end;
Why!?
Say that my OS is win98A . and ado version is 2.7?
ASKER
please save me meiki in (masetr-detail sql ) question.
well will try,
but i'm short in time.
does it have time until weekend?
(at weekend i'm not so under pressure,
so that i can look closer to this problem)
about the problem above,
there is another possibility to check,
if a keyword is assigned to an article
(i've heard, but this never happened to me,
that locate sometimes will not work properly)
solution follows later
meikl ;-)
but i'm short in time.
does it have time until weekend?
(at weekend i'm not so under pressure,
so that i can look closer to this problem)
about the problem above,
there is another possibility to check,
if a keyword is assigned to an article
(i've heard, but this never happened to me,
that locate sometimes will not work properly)
solution follows later
meikl ;-)
ASKER
I will see you as soon as possible for you.
i accept your answer and thanks for every assisting in this question and other questions.
GOD BLESS YOU.
hamid reza
i accept your answer and thanks for every assisting in this question and other questions.
GOD BLESS YOU.
hamid reza
ASKER
any feed back from you, meikl?
ASKER
any feed back from you meikl?
on thing:
about the problem of this question(locate problem).
i was found that if the key of seraching is increased to more than one key this problem was occured.
See you as soon as probable.
God bless you
Hamid reza
on thing:
about the problem of this question(locate problem).
i was found that if the key of seraching is increased to more than one key this problem was occured.
See you as soon as probable.
God bless you
Hamid reza
well, a replacemant,
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig ned(AArtic leID, AKeyWordID : Integer) : Boolean;
const vSQL = 'select * from KeywordArticle where AID = %d and KeyWordId = %d';
begin
ADOQuery1.SQL.Text := Format(vSQL,[AArticleID,AK eyWordID]) ;
ADOQuery1.Open;
result := ADOQuery1.IsEmpty;
ADOQuery1.Close;
end;
will be a bit slower than locate, but safer
hope this helps
meikl ;-)
//check if a Keyword is already assigned
function TForm1.KeyWordIDisNotAssig
const vSQL = 'select * from KeywordArticle where AID = %d and KeyWordId = %d';
begin
ADOQuery1.SQL.Text := Format(vSQL,[AArticleID,AK
ADOQuery1.Open;
result := ADOQuery1.IsEmpty;
ADOQuery1.Close;
end;
will be a bit slower than locate, but safer
hope this helps
meikl ;-)
ASKER
Hi,
Great, the previous problem solved.
Every day I have a new problem !
You implement my request work with dbgrid(that exist a lookup field for showing the related field in article table).
But ,The other changes such as delete and edit of keywords for a special article is unavailable(this unavailable for lookup field).
Do any work that add these features to dbgrid or if adgrid have not these branch of features any other work existed for implementing these features(ps: I cant use express quantum grid for its price although the copyright law is not attention in my country)?
My request :
I want to show the keywords for special article and change or delete keyword in this article but in m-n relationship
I cant, why?
I need m-n relationship.
Thanks in advance
God bless you
Hamid reza
Great, the previous problem solved.
Every day I have a new problem !
You implement my request work with dbgrid(that exist a lookup field for showing the related field in article table).
But ,The other changes such as delete and edit of keywords for a special article is unavailable(this unavailable for lookup field).
Do any work that add these features to dbgrid or if adgrid have not these branch of features any other work existed for implementing these features(ps: I cant use express quantum grid for its price although the copyright law is not attention in my country)?
My request :
I want to show the keywords for special article and change or delete keyword in this article but in m-n relationship
I cant, why?
I need m-n relationship.
Thanks in advance
God bless you
Hamid reza
ASKER
any feed back from you
ASKER
hi meikl,
i was solved my problem
thankd for your every assisting
hamid reza
i was solved my problem
thankd for your every assisting
hamid reza
for check and supplying your id.
what database do you use and
what connectiontype (bde, ado, other)?
meikl ;-)