Jan 12, 2009 02:51 PM|Mikesdotnetting|LINK
Here's a VB sample that will work with ASP.NET:
Dim ConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= " & Server.MapPath("sampleattempt.mdb")
Dim SqlString As String = "Select Description From ConferenceList Where Name = 'Economic Conference'"
Using conn As New OleDbConnection(ConnString)
Using cmd As New OleDbCommand(SqlString, conn)
Using reader As OleDbDataReader = cmd.ExecuteReader()
TextBox1.Text = reader("Description").ToString()
In this case, you know that filter criteria is Name = 'Economic Conference'. However. most often, you will be selecting records based on a value that the user supplies from a DropDownList or similar. In that case, you need to work with parameters. Here's
an article that will help you with that:
There are also some DataControls that should help you with Access:
I'm not sure where you got your original sample from, but don't trust it any further as a source of knowledge.