04. september 2009 - 10:06Der er
23 kommentarer og 1 løsning
det indtastede udtryk er for komplekst
Hej Experter
Jeg har lavet en forespørgsel i Access 2007, i denne forespørgsel er der en kolonne med IIF statment. Der er 22 IIF og når jeg vil teste det får jeg denne meddelse "Det indtastede udtryk er for komplekst" Hvis jeg der imod sletter nogle betingelser (8 stk.) så virker det, men problemet er at jeg SKAL bruge alle 22 og sikkeret flere med tiden - Kan det lade sig gøre?
Teknologi, AI og forretning er i centrum på Computerworlds Cloud og AI Festival i København d. 18. og 19. september. Se hele programmet for den store konference om strategisk brug af Cloud og AI på: www.cloud-festival.dk
Public Function MyUser(Agent_ID As String) As Integer
Select Case Agent_ID
Case "Admin" MyUser = 0 Case "DK1" MyUser = 2 Case "AU-2006" MyUser = 3 Case "GR-2007" MyUser = 4 Case "PT-2025" MyUser = 5 Case "BE-1953" MyUser = 6 Case "ES-2000" MyUser = 7 Case "IE-2031" MyUser = 8 Case "FI-1055" MyUser = 9 Case "UK-2065" MyUser = 10 Case "US-1881" MyUser = 11 Case "SE-1963" MyUser = 12 Case "DE-1438" MyUser = 13 Case "NL-1836" MyUser = 14 Case "DK-HQ-norden-8000" MyUser = 15 Case "DK-HQ-retail-8001" MyUser = 16 Case "IR-2035" MyUser = 17 Case "FR-2036" MyUser = 18 Case "PL-2041" MyUser = 19 Case "SY-2215" MyUser = 20 Case "ASIEN-2046" MyUser = 21 Case "TRAVEL-retail-2083" MyUser = 22
I got yours mail - and I seems to work perfect local. But when I uploaded the DB, I cant connect to it through a *.asp document. When I try that I get this error: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'MyUser' in expression
Sorry I wasnt aware that the query was going to be used through ASP. I havent worked so much with ASP so I'm just guessing here. Before the SQL gets sent to the Access dB it gets check to make sure the syntax is correct and because it doent know that the function exists the it fails.
I think the solution now is to alter the design of your dB. And as I mentined in a mail, if you received it, this will be the correct way to do it.
Here is what I wrote:
"I would suggest that you put all of the Agents details into a separate table and then include the table in the query or even a Dlookup to get the agent number from the table. Even better replace the text name in the main table with the actual number and the related table contains the text. This in my opinion is the correct way to do it, that's if I have understood your dB correctly :o)"
I'm a bit puzzled now. in your comment tir. d. 08. september 2009 kl. 12:08:41
you say it works local but not whan using ASP. The dB I sent was the one you have working.
I only suggested you alter your database design so that the Agents information is in another table. I didn tmake an example as I'm not 100% sure that its what you want.
I have google this quistion a lot, and I dont think it possibly. So now I try to use yours script and push the information to another DB and connect to the DB from *.asp.
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.