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

Click here to load this message in the networking platform