Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem in ADO
Message
 
À
06/06/2002 00:11:46
Jeffrey Ang
JGA Software Inc.
Davao, Philippines
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Divers
Thread ID:
00665266
Message ID:
00665355
Vues:
17
I often use recordset for query and for displaying purpose. I never use the 3 action methods of the recordset (AddNew, Update, Delete). When I need to update, I always use a SQL action query (insert, update, delete) and refresh my recordset.


>I created an updatable recordset that fetch records from two related tables Employer and Employees and I join dis tables inorder to get the name of Employer and here's my code:
>
>Dim EmployeesRs as ADODB.Recordset
>
>odal.GetRecordset "SELECT A.m0_Employees,A.SSSNum,A.FullName,B.EmployerName,A.BirthDate,A.DateHired,A.DateSep FROM Employees A INNER JOIN Employer B ON A.f0_Employer = B.m0_Employer ORDER BY A.m0_Employees", EmployeesRs, adUseClient, adOpenStatic, adLockOptimistic
>
>GetRecordset is a method from a Class(odal) that would Return a Recordset to EmployeesRs
>
>My problem is when i delete a record in Employees Recordset(EmployeesRs.Delete), The referenced Record in Employer will also deleted. My purpose of having dis recordset is 4 my data entry.
>
>I came up with one solution but i think it's not a good practice, I use 2 recordset one 4 data entry(updatable recordset)and one 4 viewing only(read only recordset that uses join)
>
>Maybe there is a good solution 4 dis, I want to use only 1 recordset 4 the sake of performance.....Thanks in advance
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform