Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Source won't update
Message
From
12/02/2002 04:10:02
Peter Walburn
Omega Data Services Ltd
Aberdeen, United Kingdom
 
 
To
12/02/2002 02:53:28
Jeffrey Ang
JGA Software Inc.
Davao, Philippines
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00618699
Message ID:
00618716
Views:
10
>hi all,
>
>i have a problem with deleting a record, it won't update my data provider.
>i use sql server as a data provider and datashape to relate my one to many relationship accessed through ado. here's my code.
>
>Dim ShapeConn as ADODB.Connection
>Dim HeaderRs as ADODB.Recordset, DetailRs as ADODB.Recordset
>
> Set ShapeConn = New ADODB.Connection
> Strconn = "Provider=MSDataShape;Data Provider=SQLOLEDB;" _
> & "Server=Jeffrey;UID=sa;Database=Personnel"
> ShapeConn.Open Strconn
>
> Set HeaderRs = New ADODB.Recordset
> HeaderRs.Open "SHAPE {SELECT * FROM header} " _
> & "APPEND ({SELECT * FROM detail} " _
> & "RELATE DocnNum TO DocnNUm) AS RsParent", ShapeConn, adOpenKeyset, adLockBatchOptimistic
> Set Detail = ActiveRs("RsParent").Value
>
>
>Private Sub CmdDelete_Click()
> HeaderRs.Delete
>End Sub
>
>I have also a delete trigger in my header table. here's the code
>
>CREATE TRIGGER DelCascade ON [Header]
>FOR DELETE
>AS
> DECLARE @document varchar(16)
> SELECT @document = DocnNum FROM deleted
> DELETE detail WHERE detail.DocnNum = @Document
>
>Thanks for the help

Hi,

I don't know if this will fix the problem, but my first thought was that the line:

Set Detail = ActiveRs("RsParent").Value

should be:

Set DetailRs = ActiveRs("RsParent").Value

Pete
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform