Results 1 to 2 of 2

Thread: SHAPE APPEND command question

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2000
    Posts
    2
    I am trying to create a recordset using the SHAPE APPEND command, and have the following written:

    rst.Open "SHAPE {SELECT * from Asset WHERE Field1='S65A0010'} " & _
    "APPEND ({SELECT * from ValAssetFeat} " & _
    "RELATE AssetID TO AssetID) AS NIC1", cnn


    The tables Asset and ValAssetFeat are linked by the AssetID key (pk in Asset and fk in ValAssetFeat).

    This will work, BUT, if I try the following:

    rst.Open "SHAPE {SELECT SerialNo, Field1 from Asset WHERE Field1='S65A0010'} " & _
    "APPEND ({SELECT * from ValAssetFeat} " & _
    "RELATE AssetID TO AssetID) AS NIC1", cnn


    where I just want the SerialNo and Field1 fields returned, I get an error as follows:

    Run-time error '-2147217900 (80040e14)':
    The referenced column (AssetID) does not exist in the appropriate rowset.

    I have tried SELECT dbo.Asset.SerialNo, SELECT Asset.SerialNo and the following whole new command:

    rst.Open "SHAPE {SELECT SerialNo, Field1 from Asset} " & _
    "APPEND ({SELECT dbo.ValAssetFeat.ValString FROM dbo.ValAssetFeat INNER JOIN " & _
    "dbo.Asset ON dbo.ValAssetFeat.AssetId = dbo.Asset.AssetId} " & _
    "RELATE AssetID TO AssetID) AS chapNIC1", _
    cnn

    all to no avail, getting various errors.

    Does anyone have any idea how to write a stupid SHAPE APPEND statement that actually works?? This is so frustrating!!

    Thanks in advance.

    Cindy

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Posts
    253
    You need to add the field called "AssetID" to the parent recordset so that you would be able to link it to the child recordset:

    rst.Open "SHAPE {SELECT AssetID, SerialNo, Field1 from Asset WHERE Field1='S65A0010'} " & _
    "APPEND ({SELECT * from ValAssetFeat} " & _
    "RELATE AssetID TO AssetID) AS NIC1", cnn

    Good Luck!!!




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width