Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Source won't update
Message
From
12/02/2002 02:53:28
Jeffrey Ang
JGA Software Inc.
Davao, Philippines
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Data Source won't update
Miscellaneous
Thread ID:
00618699
Message ID:
00618699
Views:
35
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
Next
Reply
Map
View

Click here to load this message in the networking platform