10/11/08 14:30
apoben
Ciao a tutti,
attualemente uso questo cmd per inserire dei dati in un database,
La domanda come posso utilizzare il medesimo codice in un altro cmd per modificare i dati ?
Un grazie per la risposta
Luca
attualemente uso questo cmd per inserire dei dati in un database,
Option Explicit Dim cn As ADODB.Connection Dim rs As ADODB.Recordset Dim stringa As String Private Sub cmdInserisci_Click() If Len(Trim(txtNome.Text)) = 0 Then MsgBox "Inserire il nome", vbCritical, "ERRORE" txtNome.SetFocus Exit Sub End If If Len(Trim(txtCognome.Text)) = 0 Then MsgBox "Inserire il cognome", vbCritical, "ERRORE" txtCognome.SetFocus Exit Sub End If stringa = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" stringa = stringa & App.Path & "\database.mdb" Set cn = New ADODB.Connection Set rs = New ADODB.Recordset cn.Open stringa rs.Open "utenti", cn, 3, 3 rs.AddNew rs("Nome") = txtNome.Text rs("Cognome") = txtCognome.Text rs.Update Set cn = Nothing Set rs = Nothing MsgBox "Inserimento effettuato", vbOKOnly, "CONFERMA" txtNome.Text = "" txtCognome.Text = "" End Sub
La domanda come posso utilizzare il medesimo codice in un altro cmd per modificare i dati ?
Un grazie per la risposta
Luca
aaa