Link to home
Start Free TrialLog in
Avatar of suran78
suran78

asked on

SQL SHAPE statement error

I am using SHAPE-APPEND-RELATE stmt.  I need immediate help.

I am using ado, asp to display results of the SHAPE statement on webpage.  The problem is that one SHAPE stmt is working fine but when I am replacing it with anothre similar SHAPe stmt which different table and column names, it is constantly giving me syntax or access violation error.

This one is working:
sqlStmtF = SHAPE {SELECT DISTINCT F.FabricID, F.SampleName FROM
(SELECT Fabrics.FabricID, Fabrics.SampleName FROM Fabrics) F,
(SELECT P.FabricID FROM PropertyData P WHERE P.PropertyID = 1) P1
WHERE (F.FabricID = P1.FabricID) ORDER BY F.SampleName}
APPEND
({SELECT FabricID, PropertyID, PropertyValue FROM PropertyData
WHERE (PropertyID = 1) ORDER BY PropertyID}
RELATE FabricID TO FabricID) AS Properties

while this one is not, even though there  us no syntax error and I checked the sql stmt embedded inside, they are giving correct results. Then why is this not workin????

SHAPE {SELECT DISTINCT F.FabricID, F.SampleName FROM
(SELECT Fabrics.FabricID, Fabrics.SampleName FROM Fabrics) F,
(SELECT BP.FabricID FROM BasicPropertyData BP WHERE BP.BasicPropertyDataID = 2) BP2
WHERE (F.FabricID = BP2.FabricID) ORDER BY F.SampleName}
APPEND
({SELECT FabricID, BasicPropertyDataID, PropertyValue FROM BasicPropertyData
WHERE (BasicPropertyDataID = 2) ORDER BY BasicPropertyDataID}
RELATE FabricID TO FabricID) AS BasicProperties
Avatar of Duane Lawrence
Duane Lawrence
Flag of United States of America image

You need to divide and conquer, in other word find out if the problem is in the SQL or on the webpage.

Open query analyser, run the bottom one.  If it runs fine, then the problem is in the webpage.

Duane
Avatar of suran78
suran78

ASKER

the sql query analyser is giving this error for both the SHAPE stmt:

[Microsoft][ODBC SQL Server Driver]Syntax error or access violation

How come the first SHAPe statement is working fine in the website ???
ASKER CERTIFIED SOLUTION
Avatar of NArentz
NArentz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial