AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Languages, Compilers and Interpreters C,C++,C#,.NET,Java,PHP,Perl,SQL and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Oct 14, 2006, 09:24   #1
I can seeee~ you !~!~!
 
Xman's Avatar
 
Join Date: Dec 2004
Location: now in Yerevan
Posts: 171
Rep Power: 4
Reputation: 10
Send a message via ICQ to Xman Send a message via MSN to Xman
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;}
Xman is offline   Reply With Quote Quote selected
Old Oct 14, 2006, 11:11   #2
I can seeee~ you !~!~!
 
Xman's Avatar
 
Join Date: Dec 2004
Location: now in Yerevan
Posts: 171
Rep Power: 4
Reputation: 10
Send a message via ICQ to Xman Send a message via MSN to Xman
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
__________________
...big space=>cool gap=>wolf's cry=>dark Night;}
Xman is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New ebooks / Новые книги acid TWARM 141 May 5, 2008 23:11
SQL Database administrator/ web developer {I} Jobs 0 Aug 25, 2005 09:18
MS SQL RAM problem armen13 Languages, Compilers and Interpreters 6 Jan 12, 2005 10:19
Sql Collation Problem Masud Languages, Compilers and Interpreters 13 Mar 21, 2004 05:08


All times are GMT. The time now is 12:42.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link