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;Passwo rd=tiger;U ser 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
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;Passwo
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
Did you post about this question in the Community Support?