|
-
May 9th, 2001, 09:16 AM
#1
ADO using Shape command and AddNew
I have this program that I started with the Visual Basic Application
wizard which threw me for the first time into the worderful world of
the Shape concept. I'm still kinda of grappling with its idiosyncrocies. I have the following shape command
shapestring = "SHAPE {select (Buncha fields here) from [Traffic Account Info] where [customer name]= " & Chr(34) & customer & Chr(34) & " " & _
" Order by [Sub Account Number],[location id]} AS ParentCMD APPEND ({select (buncha fields here) from [Signal Info] } AS ChildCMD RELATE [Location Id] TO [Location Id]) AS ChildCMD "
Then it opens an ADO recordset using
adoPrimaryRS.Open shapestring, db, adOpenStatic, adLockOptimistic
Then the returned fields for the parent of the shape command are bound to textboxes and the returned fields for the child are bound to a datagrid.
When I hit the "Add" button the following is processed
With adoPrimaryRS
If Not (.BOF And .EOF) Then
mvBookMark = .Bookmark
End If
.AddNew
End with
and I can update any field in the parent textboxes but nothing in the child datagrid.
I suspect this has to do with the foreign key constraint but I don't really know.
So my question is....
Is it possible to add a record to the child and if so HOW LOL
Thanks in advance,
Pete
-
May 9th, 2001, 10:01 AM
#2
Re: ADO using Shape command and AddNew
You need to call you childcmd.properties to manipulate your child recordset
see this link
http://msdn.microsoft.com/library/de...k/olpr0838.htm
-
May 9th, 2001, 10:24 AM
#3
Re: ADO using Shape command and AddNew
thanks so much... and you should feel impressed with yourself 2 days on 4 forums and you were the only reply. Thanks again... it was a huge help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|