Oops... avevo dimenticato il codice
Imports System.Data.OleDb
Imports System.Windows.Forms
Public Class frmArchivio
Dim percorso As String = "Data Source=C:\Documents and Settings\Vito\Desktop\provaData\elenco_sposi.mdb"
Dim conn As String = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\provaData\elenco_sposi.mdb"
Dim cn As New OleDbConnection(conn)
Private Sub frmArchivio_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub cmdConnetti_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnetti.Click
If cmdConnetti.Text = "&Connetti" Then
cn.Open()
cmdConnetti.Text = "&Disconnetti"
Else
cmdConnetti.Text = "&Connetti"
cn.Close()
End If
If cn.State = ConnectionState.Open Then
MessageBox.Show("Il db adesso è connesso", _
"Attenzione", MessageBoxButtons.OK, _
MessageBoxIcon.Information)
End If
End Sub
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
Dim nomiSposi As String = txtAdd.Text
Dim qry As String
qry = "INSERT INTO tabellaSposi (IDsposi) VALUES ('&nomiSposi&')"
txtAdd.Text = ""
End Sub
Private Sub txtAdd_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtAdd.TextChanged
End Sub
End Class