I have store some data in spreadsheet (excel sheet) ,I have already transfer
this data from database,but only transfer from cdname to size, another values
not transfer ,show run tim error 3265.please help me.
This my code:
Private Sub btnsave_Click()
Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and
Settings\mangala\My Documents\CD catalog .db1.mdb;Persist Security Info=False;"
Set rs = New ADODB.Recordset
rs.Open "CDcontents", cn, adOpenKeyset, adLockOptimistic, adCmdTable
r = 2 ' the start row in the worksheet
Do While Len(Range("A" & r).Formula) > 0
With rs
.AddNew ' create a new record
' add values to each field in the record
.Fields("CDname") = Range("A" & r).Value
.Fields("CDlocation") = Range("B" & r).Value
.Fields("Bouchname") = Range("C" & r).Value
.Fields("CDnumber") = Range("D" & r).Value
.Fields("Filename") = Range("E" & r).Value
.Fields("Size") = Range("F" & r).Value
.Fields("Created date") = Range("G" & r).Value
.Fields("Date Modified") = Range("H" & r).Value
.Fields("Date Accessed") = Range("I" & r).Value
.Fields("Company") = Range("J" & r).Value
.Fields("Description") = Range("K" & r).Value
.Fields("File Version") = Range("L" & r).Value
.Fields("Product Name") = Range("M" & r).Value
.Fields("Product Version") = Range("N" & r).Value
' add more fields if necessary...
.Update ' stores the new record
End With
r = r + 1 ' next row
Loop
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End sub