Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Source won't update
Message
De
12/02/2002 02:53:28
Jeffrey Ang
JGA Software Inc.
Davao, Philippines
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Data Source won't update
Divers
Thread ID:
00618699
Message ID:
00618699
Vues:
36
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform