Imports
System.DataImports
System.Data.OleDbPublic
Class Form1Inherits System.Windows.Forms.Form#
Region " Windows Form Designer generated code "Public Sub New()MyBase.New()'This call is required by the Windows Form Designer.InitializeComponent()
'Add any initialization after the InitializeComponent() callEnd Sub'Form overrides dispose to clean up the component list.Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)If disposing ThenIf Not (components Is Nothing) Thencomponents.Dispose()
End IfEnd IfMyBase.Dispose(disposing)End Sub'Required by the Windows Form DesignerPrivate components As System.ComponentModel.IContainer'NOTE: The following procedure is required by the Windows Form Designer'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor.<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()''Form1'Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)Me.ClientSize = New System.Drawing.Size(292, 214)Me.Name = "Form1"Me.Text = "Form1"End Sub#
End RegionPrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.LoadDim conn As New OleDbConnectionconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c: este.mdb"
Dim cmd As OleDbCommand = conn.CreateCommandcmd.CommandText = "insert into Clientes (Nome) value (Leonardo,'Nome')"
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
MsgBox("Registro incluido")
End SubEnd
Class
dá um erro assim: An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
Alguém tem algum palpite?