Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 14.10.2006, 10:24   #1
I can seeee~ you !~!~!
 
Xman's Avatar
 
Join Date: 12 2004
Location: now in Yerevan
Age: 32
Posts: 171
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Question SQL query for Access.MDB file doesn't work,F1

Hello World.
значит уменя код конектируется с файлом mdb , и код динамически генерирует SQL запрос ,так вот этот самый зпрос нормалро работает если его запустить скажем в ms sql, и тот же код работает в коде но только при критериях когда запрос создан для 2 язиков, а вот при болше 2 яазыков код перехватывет исключение: Syntax error (missing operator) in query expression ''. Но синтаксической ошибки нету, сами судитеЖ:

SQL for 2 languages:
SELECT Dictionary.[Text] AS Lang_0, Dictionary1.[Text] AS Lang_1
FROM Dictionary INNER JOIN
Dictionary Dictionary1 ON Dictionary.GroupID = Dictionary1.GroupID
AND Dictionary.LanguageCode <> Dictionary1.LanguageCode
WHERE (Dictionary.LanguageCode = 'en-us') AND (Dictionary1.LanguageCode = 'fr-fr')
ORDER BY Dictionary.GroupID;

SQL for 3 languages:
SELECT
Dictionary.[Text] AS Lang_0,
Dictionary1.[Text] AS Lang_1,
Dictionary2.[Text] AS Lang_2
FROM Dictionary
INNER JOIN
Dictionary Dictionary1 ON Dictionary.GroupID = Dictionary1.GroupID
AND Dictionary.LanguageCode <> Dictionary1.LanguageCode
INNER JOIN
Dictionary Dictionary2 ON Dictionary.GroupID = Dictionary2.GroupID
AND Dictionary.LanguageCode <> Dictionary2.LanguageCode

WHERE
(Dictionary.LanguageCode = 'de-de') AND
(Dictionary1.LanguageCode = 'el') AND
(Dictionary2.LanguageCode = 'it-it')
ORDER BY Dictionary.GroupID;

вот.
если кто знает в чём проблема дайте знать пожалуйста.
Я думаю что тут причина в особенностях Access,о которых я не имею понятие.
__________________
...big space=>cool gap=>wolf's cry=>dark Night;}
Reply With Quote
Old 14.10.2006, 12:11   #2
I can seeee~ you !~!~!
 
Xman's Avatar
 
Join Date: 12 2004
Location: now in Yerevan
Age: 32
Posts: 171
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Well I have already found the reason,in MDB query scopes are important:

SQL Query for 4 Languges:

SELECT Dictionary.[Text] AS Lang_0, Dictionary1.[Text] AS Lang_1,
Dictionary2.[Text] AS Lang_2, Dictionary3.[Text] AS Lang_3
FROM (((Dictionary
INNER JOIN
Dictionary Dictionary1 ON Dictionary.GroupID = Dictionary1.GroupID AND Dictionary.LanguageCode <> Dictionary1.LanguageCode)
INNER JOIN
Dictionary Dictionary2 ON Dictionary.GroupID = Dictionary2.GroupID AND Dictionary.LanguageCode <> Dictionary2.LanguageCode)
INNER JOIN
Dictionary Dictionary3 ON Dictionary.GroupID = Dictionary3.GroupID AND Dictionary.LanguageCode <> Dictionary3.LanguageCode)

WHERE (Dictionary.LanguageCode = 'en-us') AND
(Dictionary1.LanguageCode = 'fr-fr') AND
(Dictionary2.LanguageCode = 'it-it') AND
(Dictionary3.LanguageCode = 'ru-ru')

ORDER BY Dictionary.GroupID


SQL Query for 3 Languages:

SELECT Dictionary.Text AS FirstLang, Dictionary_1.Text AS SecondLang, Dictionary_2.Text AS ThirdLang
FROM ((Dictionary INNER JOIN
Dictionary Dictionary_1 ON Dictionary.GroupID = Dictionary_1.GroupID AND Dictionary.LanguageCode <> Dictionary_1.LanguageCode)
INNER JOIN
Dictionary Dictionary_2 ON Dictionary.GroupID = Dictionary_2.GroupID AND Dictionary.LanguageCode <> Dictionary_2.LanguageCode)
WHERE
(Dictionary.LanguageCode = 'en-us') AND (Dictionary_1.LanguageCode = 'ru-ru') AND (Dictionary_2.LanguageCode = 'fr-fr')
ORDER BY Dictionary.GroupID


SQL Query for 2 Languages:
in this case scopes are nt necessary but for example:

SELECT Dictionary.Text AS FirstLang, Dictionary_1.Text AS SecondLang
FROM (Dictionary INNER JOIN
Dictionary Dictionary_1 ON Dictionary.GroupID = Dictionary_1.GroupID AND Dictionary.LanguageCode <> Dictionary_1.LanguageCode)
WHERE (Dictionary.LanguageCode = 'en') AND (Dictionary_1.LanguageCode = 'ru')
ORDER BY Dictionary.GroupID
Reply With Quote
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 06:06.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.