+ Reply to Thread
Results 1 to 2 of 2

multiple-step OLE DB operation generated errors. check each OLE DB status value, if avail

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-01-2014
    Location
    Mysore
    MS-Off Ver
    Excel 2007
    Posts
    379

    multiple-step OLE DB operation generated errors. check each OLE DB status value, if avail

    I am getting error --> multiple-step OLE DB operation generated errors.
    check each OLE DB status value, if available.No work was done
    Please help me out
     Sub updatedata()
    
    Dim dbconn As New ADODB.Connection
    Dim stDB, strConn
    
    Dim totColumns, totRows, i, j, BMS_id, UpdateprBatchName
    Dim prBatchName, prTableQry, inTableQry, prTableQry1, dbQry
    Dim rs As New ADODB.Recordset
    
     'Path to the database.
        stDB = "mysql32"
    
         'Create the connectionstring.
        strConn = "Driver=MySQL ODBC 5.2 Unicode Driver;" _
        & "Data Source=" & stDB & ";"
    
    Sheet1.Activate
    'prBatchName = "tblprod_agr_007"
    
    totColumns = ActiveSheet.Cells(2, 1).CurrentRegion.Columns.Count
    totRows = ActiveSheet.Cells(3, 1).CurrentRegion.Rows.Count
    
     'prBatchName = ActiveSheet.Cells(3, totColumns + 1).Values
    dbconn.Open strConn
    rs.CursorLocation = adUseServer
    rs.Open "select * from " & InputBox("Update Data"), dbconn, adOpenStatic, adLockOptimistic
        For j = 3 To totRows + 1
           BMS_id = ActiveSheet.Cells(j, 1)
            rs.Find "BMS_ID=" & BMS_id
            
            For i = 3 To totColumns
            rs(ActiveSheet.Cells(2, i).Value) = ActiveSheet.Cells(j, i)     ---------> i getting error here on this Line
            Next
            rs.Update
              Next
    rs.Close
    dbconn.Close
    MsgBox "Data updated sucessfully"
    End Sub

  2. #2
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: multiple-step OLE DB operation generated errors. check each OLE DB status value, if a

    Hi Baig123,

    Try this,
    For i = 3 To totColumns
            rs(ActiveSheet.Cells(2, i).Value) = ActiveSheet.Cells(j, i)    
            rs.Update
    Next

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Why are #Value! errors being generated in this spreadsheet?
    By Aceso in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 03:15 PM
  2. % of days worked and errors generated
    By andycuk7 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-06-2012, 09:40 AM
  3. Replies: 0
    Last Post: 09-13-2011, 01:03 AM
  4. VB error for HTTP status request - Operation time out
    By Monto Roy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2009, 11:30 AM
  5. [SOLVED] Excel has generated Errors
    By Denz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2005, 04:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1