Home All Groups Group Topic Archive Search About

adding records to an access db

Author
28 Jun 2006 6:46 PM
reidarT
I have an unbound form with two fields,
Date and Name.
I want to enter text in theese two fields and then click a button
to add the text in a row in an Access db.
What is the easiest way to do this?
reidarT

Author
28 Jun 2006 2:24 AM
Scott M.
Dim con As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data
Source=<database path here>")
Dim cmd As New OleDb.OleDbCommand("INSERT statement here", con)

Try
    con.open
    cmd.ExecuteNonQuery
Catch ex As OleDbException
    'error handling here
Finally
    con.close
End Try

Show quoteHide quote
"reidarT" <rei***@eivon.no> wrote in message
news:OVEOCohmGHA.4164@TK2MSFTNGP03.phx.gbl...
>I have an unbound form with two fields,
> Date and Name.
> I want to enter text in theese two fields and then click a button
> to add the text in a row in an Access db.
> What is the easiest way to do this?
> reidarT
>