HO IL SEGUENTE CODICE:
#Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' If CheckBox2.Checked Then
' mod_maschera = True
'ElseIf CheckBox3.Checked Then
'mod_maschera = False
'End If
'If CheckBox4.Checked Then
'consul_listini = True
'ElseIf CheckBox5.Checked Then
'consul_listini = False
'End If
'If CheckBox6.Checked Then
'consul_listini = True
'ElseIf CheckBox7.Checked Then
'consul_listini = False
'End If
'If CheckBox8.Checked Then
'accesso_articoli = True
'ElseIf CheckBox9.Checked Then
'accesso_articoli = False
'End If
Dim utente As String = TextBox1.Text
If String.IsNullOrEmpty(utente) Then
MessageBox.Show("Devi inserire un utente")
TextBox1.Focus()
Exit Sub
End If
'Dim con As New ClsDati()
'Dim ds As DataSet
Dim stringSql1 As String = "INSERT INTO UTENTI(Utente,Password) VALUES ('" & utente & "','VV')"
MessageBox.Show(stringSql1)
Dim m_StrConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\enzo.ENZO-59B7B5DDEE\Documenti\Visual Studio 2005\Projects\prova\prova\Db1.mdb;Persist Security Info=False"
'con.ExecuteNonQuery(stringSql1)
Dim vConn As New OleDbConnection(m_StrConn)
Dim vComm As New OleDbCommand()
Try
vConn.Open()
vComm.CommandText = stringSql1
vComm.Connection = vConn
vComm.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.ToString, "Errore di accesso ai dati")
End Try
'Dim stringSql2 As String = "SELECT ID FROM UTENTI WHERE Utente='" & utente & "'"
'ds = con.ExecuteQuery(ClsDati.ReturnType.DataSetType, stringSql2)
'Dim ID As String = ds.Tables("UTENTI").Rows(0).Item("ID")
'Dim stringSql3 As String = "INSERT INTO PERMESSI(FK_UTENTE) VALUES(" & ID & ")"
'con.ExecuteNonQuery(stringSql3)
End Sub
ma arrivati all'istruzione vComm.ExecuteNonQuery() ottengo una eccezione di errore di sintassi nella INSERT ma non so cosa possa essere
tulipan