Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Advanced ADO - Data Shaping(withgrandchildren)

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-01 : 09:17:03
Ryan writes "Hey folks,

Now my question doesn't really pertain to SQL Server, it is the db I am running. It's an ADO question. I have traveled to many message boards from 4guysfromRolla.com to ASP101.com and no one, absolutely no one has been able to assit me. One of the regular peps on 4guysfromRolla.com in the db, ado section told me that you guys don't mess around and are pretty hardcore.

To the point! I am working with ADO and Data Shaping using ASP to return a RS from my SQL Server. I don't know if my grandchildren syntax is correct and all of the example on the web only show a sigle grandchild, not multiple. At the same time these article say you can use multi-grandchildren, they don't give an example. Here is a gif I designed to give you a more visual idea of what I am attempting:


<img src="http://www.buzzuti.com/temp/datashap_gc3.gif">


This image has abbreviated field names to condense the whole thing!

Here is my code:
'*******************************************
mySQL =
"SHAPE {SELECT id,loannumber,flowitem,comment1,comment2,comment3 FROM tblflowsheet WHERE loannumber='" & intLN & "' ORDER BY flowitem}
APPEND
(
(
SHAPE {SELECT id,flowitem,com1,com2,com3,fldcomtotal FROM tblflowitems WHERE fldflowtype='" & strLT & "'} AS tblflowitems
APPEND
({SELECT id,flowcomment FROM tblflowcom} AS tblflowcom
RELATE com1 TO id),
({SELECT id,flowcomment FROM tblflowcom} AS tblflowcom2
RELATE com2 TO id),
({SELECT id,flowcomment FROM tblflowcom} AS tblflowcom3
RELATE com3 TO id))
RELATE flowitem TO id)"

'****************************************

Is this syntax correct? I get this error when this line of code executes...

Set rsConnCom = rsConn("tblflowcom").Value
strCom1 = rsConnCom("fldcomment")

Item cannot be found in the collection corresponding to the requested name or ordinal.

Now, my spelling on all table columns has been check, and double check again and again.... So, I know that isn't the problem.

I know this might seem novice maybe, it might be a little vague, and my question might not pertain to SQL Server at all, but I don't know where else to turn... I appreciate any assistence in my issue whatsoever, even if that means the response is "sorry can't help!" :)

Sincerely,
Ryan Anderson

Running SQL Server 2000 on a WIN2K Server (not advanced server, just regular decafe server!)"

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-04-01 : 18:57:16
Hi there

It has been a while since I did any data shaping so I am not sure. But datashaping is "sooooooo Q4-99", I have never had a situation where I really needed to use it anywhere, certainly it isn't something MS like to talk about too much, which leads me to belive they may just drop it one day. (Is it in .NET anywhere ?? I don't know)

I would suggest a few other ways do do whatever you are trying to do.

Firstly, just pull out all your records and only display the higher level ones when they change. The ASP to do that isn't hard.

Or, use XML. This is sort of becomming the standard for heiracical (sp?) data. You can build a heiracical XML document using the FOR XML EXPLICIT clause in your query. If you look in BOL for that clause you will find an example using northwind that is really cool.

Then use ADO to retrieve the XML and pass it to the XMLDOM to work with it.

Hope that helps a little. If you still want to use datashaping, I can't help, but I have bumped the thread to the top so someone else might

Damian
Go to Top of Page
   

- Advertisement -