Link to home
Start Free TrialLog in
Avatar of srinivas_gowd
srinivas_gowd

asked on

Manipulations with Recordset with join Condition

Hi

Can any body help me

here is the small example program please go throuth it and suugest me a wayout

tables :emp,dept

take adodc control,assign connection string for scott user
Privider "Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=nisag;Persist Security Info=True"
and recordsource :"select a.*,b.* from emp a,dept b where a.deptno=b.deptno"

i took one MSHFlexGrid1 ,and assigned the adodc control to grid datasource

i want to write functionality like,when i double click on one row in grid,one window willbe populated with the data (in text boxes) in edit mode,can be modified and upadted.if we want to add new record i want to populate same screen with empty fields,allow user to enter and say update,

i want the above functionality,here is the code,its giving problem,please check and tell me the right way


Option Explicit

Private Sub Command1_Click()
With Adodc1.Recordset
    .AddNew
    .Fields("EMPNO") = txtEmpNo
    .Fields("ENAME") = txtEmpName
    .Fields("JOB") = txtJob
    .Fields("MGR") = IIf(IsNull(txtMGR) = True, "", txtMGR)
    .Fields("HIREDATE") = mskHireDate
    .Fields("SAL") = txtSalary
    .Fields("COMM") = txtComm
    .Fields("DEPTNO") = txtDeptNo
    .Update
    Adodc1.Refresh
End With
End Sub

Private Sub Command2_Click()
Adodc1.Recordset.Delete adAffectCurrent
Adodc1.Refresh
End Sub


thanks in Advance

Srinivas Gowd
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
TimCottee,

Did you post about this question in the Community Support?
Actually LeonStryker I didn't. I just posted the open questions stuff and didn't really notice that it had been accepted as an answer, even got a 'B' grade. I guess I should really ask for it to be deleted.