Results 1 to 3 of 3

Thread: how will updat access db by vb6 ADODB

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2010
    Posts
    24

    how will updat access db by vb6 ADODB

    run time error 3251
    current recordset does not support updating




    Code:
    Private Sub Add_Click()
    
    ' Creating Connection
    Dim adoCon As ADODB.Connection
    Set adoCon = New ADODB.Connection
    
    Dim conString As String
    conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\MobileService.mdb;User Id=Admin;Password=;"
    
    adoCon.Open conString
    
    
    ' creating Querry
    Dim ar As ADODB.Recordset
    Set ar = New ADODB.Recordset
    Dim sqlstr As String
    sqlstr = "Select * FROM ServiceDetail"
    
    ar.Open ("ServiceDetail"), adoCon
    
    ' "Select DLNAME FROM ServiceDetail", adoCon, adOpenForwardOnly, adLockReadwrite, adCmdText
    
    ar.AddNew
    ar.Fields("DLNAME") = Text1.Text
    ar.Fields("MOBILE_MO") = Text2.Text
    ar.Fields("PROBLEM") = Text3.Text
    ar.Fields("CHRAGES") = Text4.Text
    'ar.Fields("DATE_S") = Date + Time
    ar.Update
    
    MsgBox "data update success fulluy ............."
    End Sub
    Last edited by Akintex; Feb 8th, 2011 at 07:11 AM.

    My Code Project
    Gsm Flashing cable finder

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width