|
From: | Meketon, Marc |
Subject: | Re: [Help-glpk] ODBC Connection to MS-Access - WHERE Clause Syntax problems |
Date: | Sat, 25 Jun 2011 14:04:03 -0500 |
Hello,
I am using the following:
set psold dimen 3;
param qper{(i,j,k) in psold};
table products_table IN "ODBC"
'DSN=glpk_Sales'
'SELECT Product, MaterialDesc as pdesc, [Manuf Code] as prodman, QPer'
'FROM qProductsUnique '
'WHERE qProductsUnique.[Manuf Code]="0012LBLK"':
psold <- [Product, pdesc, prodman], qper~QPer;
display psold;
------------------------------------------
qProductsUnique is a MS Access Query that returns unique records. The data (0012LBLK) exists in the query.
I have tried many different syntax constructions for the WHERE clause and none work. Removing the WHERE clause works fine, which suggests (to me the novice) that all of the field names are correctly specified.
For the above WHERE clause syntax the following error is received:
=====
The driver reported the following diagnostics whilst running SQLExecDirect
42000:1:-3100:[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query _expression_ 'qProductsUnique.[Manuf Code]=[0012LBLK]D'.
Yorke.mod:155: error on opening table products_table
=====
I don't know what the D means after [0012LBLK].
I really want to restrict the records to the following
'WHERE qProductsUnique.[Manuf Code] Not Like "_*"':
But that would not work also - and that is why I tried something that I thought was simple.
I am not a programmer and do not understand the ODBC / SQL syntax. I have spent a long time researching these errors and found nothing that I believe will help.
I have placed a space at the end of the FROM clause - I would appreciate if someone would also confirm if that is necessary. When I remove the space at the end of the FROM clause I get a different error message --
=====
The driver reported the following diagnostics whilst running SQLExecDirect
07002:1:-3010:[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
Yorke.mod:155: error on opening table products_table
=====
I would appreciate any assistance.
Regards, Alex
[Prev in Thread] | Current Thread | [Next in Thread] |