I'm using VB6 and SQL Server 7
Here is the code
Dim rcd As New ADODB.Recordset
Private Sub cmdGuardar_Click()
Dim sSQL As String
sSQL = "select * from alta_prod where id_prod = 0"
rcd.Open sSQL, cn, adOpenKeyset, adLockOptimistic
rcd.AddNew
rcd.Fields("ID_PROD" = cmbProductos.ItemData(cmbProductos.ListIndex)
rcd.Fields("FEC_ALTA" = Date
rcd.Fields("CANT_PROD_ALTA" = txtCantidad
rcd.Fields("REALIZO_ALTA" = txtRealizo
rcd.Update 'at this point the VB hangs up
rcd.Close
End Sub
The program inserts data into the table but after that the program Locks and not responding, There aren't any VB error o SQL error, the app just hangs up
Here is the code
Dim rcd As New ADODB.Recordset
Private Sub cmdGuardar_Click()
Dim sSQL As String
sSQL = "select * from alta_prod where id_prod = 0"
rcd.Open sSQL, cn, adOpenKeyset, adLockOptimistic
rcd.AddNew
rcd.Fields("ID_PROD" = cmbProductos.ItemData(cmbProductos.ListIndex)
rcd.Fields("FEC_ALTA" = Date
rcd.Fields("CANT_PROD_ALTA" = txtCantidad
rcd.Fields("REALIZO_ALTA" = txtRealizo
rcd.Update 'at this point the VB hangs up
rcd.Close
End Sub
The program inserts data into the table but after that the program Locks and not responding, There aren't any VB error o SQL error, the app just hangs up