views:

2

answers:

0

I'm creating a simple TimeStamp when the save button is pressed to just add the current date and time to a MS Access 2003 DB. I have that code working. I'm using Access 2003 and Visual Studio Express 2010.

Dim myConnection As OleDbConnection = New OleDbConnection()
    Dim addSQL As String = ("INSERT into DateTable (DateUpdated) values" & _
        "(Now())")
    myConnection.ConnectionString = ("Provider=Microsoft.jet.oledb.4.0;data source=db1.mdb")
    cmd = New OleDbCommand(addSQL, myConnection)
    myConnection.Open()
    cmd.ExecuteNonQuery()
    myConnection.Close()

After this is submitted to the DB, i'm trying to get a TextBox or Label to display to query the DB and show the last record. I've searched and can't seem to find the solution, any help is appreciated. All I have so far is possibly the query string.

Dim SQLQuery As String = "SELECT * from DateTable WHERE Dateupdated = '" & TextBox2.Text & "'"