Results 1 to 2 of 2

Thread: Error 3265 while uploading Data

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jan 2021
    Posts
    1

    Error 3265 while uploading Data

    It is giving error 3265 can anyone help

    Code:
    Private Sub CommandButton1_Click()
    Dim cnn As ADODB.Connection 'dim the ADO collection class
    Dim rst As ADODB.Recordset 'dim the ADO recordset class
    Dim dbPath
    Dim x As Long, i As Long
    Dim nextrow As Long
    Dim table As Range
            'Set Data = Range("B39")
            Set table = Range("XFD25")
    
    'add error handling
    On Error GoTo errHandler:
    dbPath = "C:\Darpan\AQF\NewQuoteIB.accdb"
    nextrow = Cells(Rows.Count, 1).End(xlUp).Row
    
    
    Set cnn = New ADODB.Connection
    
    'Check for data
    'If Sheet2.Range("A2").Value = "" Then
    If ActiveSheet.Range("A2").Value = "" Then
    MsgBox " Add the data that you want to send to Database"
    Exit Sub
    End If
    
    cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & dbPath
    Set rst = New ADODB.Recordset 'assign memory to the recordset
    
    'rst.Open Source:="AGS", ActiveConnection:=cnn, _
    'rst.Open source:="Euronet", ActiveConnection:=cnn, _'
    '
    rst.Open source:=Range("R1").Value, ActiveConnection:=cnn, _
    CursorType:=adOpenDynamic, LockType:=adLockOptimistic, _
    Options:=adCmdTable
    
    
    'you now have the recordset object
    'add the values to it
    For x = 2 To nextrow
    rst.AddNew
    For i = 1 To 10
    rst(Cells(1, i).Value) = Cells(x, i).Value
    Next i
    rst.Update
    Next x
    
    'close the recordset
    rst.Close
    ' Close the connection
    cnn.Close
    'clear memory
    Set rst = Nothing
    Set cnn = Nothing
    
    'communicate with the user
    'MsgBox " The data has been successfully sent to the access database"
    
    'Update the sheet
    Application.ScreenUpdating = True
    
    MsgBox "Record submitted successfully"
    On Error GoTo 0
    Exit Sub
    errHandler:
    
    'clear memory
    Set rst = Nothing
    Set cnn = Nothing
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Export_Data"
    
    Call closebox
    End Sub
    Last edited by si_the_geek; Jan 20th, 2021 at 06:40 PM. Reason: added Code tags

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,196

    Re: Error 3265 while uploading Data

    Just saying your getting error 3265 is enough. What's the error description? What line of code is causing the error?

    FYI - Code should always be posted in between code tags so it keeps it's formatting. Click the "#" on the toolbar.

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