Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with Data Environment

Status
Not open for further replies.

melbe

Programmer
Apr 28, 2003
6
0
0
MX
Hi !
I'm trying to add a new record through a command on a Data Environment...
I have this settings...
- command text: SELECT * FROM Emp_Nomina_Ev
- Command type: 1-adCmdText
- Cursor Location: adUseClient
- Cursor Type: adOpenStatic
- LockType: adLockOptimistic
------------------------------
On my Add Button i have this:

With DataNomina.rsTEmp_nomina_ev
.AddNew
!cve_nomina = MVar.Nomina
!cve_emp = CInt(txtCveEmp.Text)
!dias_lab = CInt(txtDiasLab.Text)
!tiempo_ex = CInt(txtTiempoEx.Text)
!alimentacion = CDbl(txtAlim.Text)
!hospedaje = CDbl(txtHosp.Text)
!ispt = CDbl(txtISPT.Text)
!gratifica = CDbl(txtGrat.Text)
!liquido = CDbl(txtLiquido.Text)
.Update
End With
BUT... I also have this error message when i'm trying to add a new record
"Execution error 3704, operation not permited if the object is closed "

I really need some help, THANKS
 
Melbe I ran into the same error. It is a very simple line you need to add. Actually two.

DataEnvironment1.Connection1.Open

then right above End Sub

DataEnvironment1.Connection1.Close

Hope this helps!!

[blues]
W. W. Findley V
Sys Admin/Programmer
SV, MX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top