I have a basic snippet of code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim db As dao.Database Dim rs As dao.Recordset Dim pathdb As String Dim txt As dao.Field Dim dbe As dao.DBEngine pathdb = "C:\Users\SashaG\Documents\db1.mdb" dbe = New dao.DBEngine() db = dbe.OpenDatabase(pathdb) rs = db.OpenRecordset("SELECT * FROM [Table1] WHERE [Key] = 3") TextBox1.Text = rs("Txn ID") End Sub
What I want is for that rs("Txn ID") record to show up in the textbox (no problems in vb6) but I'm getting an error which says:
"value of type 'dao.field' cannot be converted to string". Any idea what I'm doing wrong?
Thanks in advance for your help!