1 Replies - 1541 Views - Last Post: 03 May 2014 - 04:11 AM Rate Topic: -----

#1 pendaz  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 75
  • Joined: 14-August 12

Update Access database programatically (append to field)

Posted 23 April 2014 - 03:08 AM

Hi all


I'm a vb.net coder and have written a project that now needs to be accessible online, so i'm working on converting it over to asp.net for web access.

Theres a section of my application that allows the user to filter a record, then append "additional notes" to an field in an existing record

I have an Accessdatasource bound to my access databasefile, and a FormView containing readonly fields which contain the information of the record filtered. then outside of the formview i have a multiline textbox (txtAdditional) and a Save button


The filter works, it displays the record by using the AccessDatasource1.FilterExpression

In my cmdSave button's click even i have:

Dim PatientID = ??????
Dim query As String = "UPDATE Enquiry Set Actiontaken='" & txtAdditionalNotes.Text & "' WHERE PatientID="& PatientID


            AccessDataSource1.InsertCommand = query
            AccessDataSource1.Insert()



Initially attempting to simply update (overwrite) the field of the currently filtered record.

PatientID is the record Index field in my database, unique and auto-incrementing - so my question is, how i can get this value into a variable so I can use it in my UPDATE query?

In the vb.net(winforms) version of my application i use the datagridview.selectedrows method of retrieving the PatientID of the selected record. is there a similar way i can achieve this with AccessDatasource1?


Please keep in mind i'm totally new (as in less than 48 hours lol) to asp.net but fairly competent with vb.net

Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Update Access database programatically (append to field)

#2 pendaz  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 75
  • Joined: 14-August 12

Re: Update Access database programatically (append to field)

Posted 03 May 2014 - 04:11 AM

anyone?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1