1 Replies - 467 Views - Last Post: 06 September 2017 - 12:30 PM Rate Topic: -----

#1 slneeluka  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-September 17

update query with accesss database in vb 6

Posted 06 September 2017 - 01:08 AM

Dear Sir,
How to write update query with accesss database in vb 6. help me
Eg.
If YearCmb <> "" Then
    Set Rs = Con.OpenResultset("Select * from Student_Mast " _
                            & "where Resign = " & False & " ", 1, 3)
    If Rs.RowCount > 1 Then
    Rs.MoveFirst
    Rs.MoveLast
    Set Rs = Con.OpenResultset("Update Student_Mast set Grde = 'GRADE 09- A' where Grde = 'GRADE 10- A' and Resign = " & False & "")
        End If
    End If 


I want Update
GRADE 08 - A TO GRADE 07 - A
GRADE 07 - A TO GRADE 06 - A
GRADE 06 - A TO GRADE 05 - A
GRADE 05 - A TO GRADE 04 - A

Neeluka

This post has been edited by Atli: 06 September 2017 - 05:32 AM
Reason for edit:: Use [code] tags when posting code.


Is This A Good Question/Topic? 0
  • +

Replies To: update query with accesss database in vb 6

#2 andrewsw  Icon User is online

  • the case is sol-ved
  • member icon

Reputation: 6379
  • View blog
  • Posts: 25,774
  • Joined: 12-December 12

Re: update query with accesss database in vb 6

Posted 06 September 2017 - 12:30 PM

For an update statement you would use an Execute method, such a statement does not return a recordset.

I do question your structure though. "Grade 08 - A" is two pieces of information, with the word "Grade" also seeming redundant. If the two values were in two separate columns it would be much easier to update and to query (and would follow database design principles). "Grade 08 - A" would still be easy to recombine if you needed this version for some display purpose.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1