J
jack
Hello, everyone. does anybody can help me out? I want to locate and write
data into the empty field which I konw is on 101 row. there are 5 rows need
be writen.
After debug the row number moved to 283 for some unkown reason.
Set db = CurrentDb
Set rs = db.OpenRecordset("master")
rs.MoveFirst
i = rs.Fields("id").Value
For i = 1 To 100
rs.MoveNext
Debug.Print rs.Fields("id").Value
Next i
Debug.Print rs.Fields("id").Value
For i = 101 To 105
Dim strFile As String
Dim strPath As String
Dim strPathNFile As String
strFile = "\" & rs.Fields("DWG_NAME")
strPath = rs.Fields("FILE_PATH")
strPathNFile = strPath + strFile
rs.Edit
If ReadBLOB(strPathNFile, rs, "IMAGE") Then 'stores the binary data
see modBlob for ReadBLOB function
rs.Update 'update the record
MsgBox "row"+ i + "Success!", vbInformation
Else
MsgBox strPathNFile & "does not exist!", vbExclamation
End If
rs.MoveNext
Next i
rs.Close
db.Close
MsgBox "Congrates All done!"
data into the empty field which I konw is on 101 row. there are 5 rows need
be writen.
After debug the row number moved to 283 for some unkown reason.
Set db = CurrentDb
Set rs = db.OpenRecordset("master")
rs.MoveFirst
i = rs.Fields("id").Value
For i = 1 To 100
rs.MoveNext
Debug.Print rs.Fields("id").Value
Next i
Debug.Print rs.Fields("id").Value
For i = 101 To 105
Dim strFile As String
Dim strPath As String
Dim strPathNFile As String
strFile = "\" & rs.Fields("DWG_NAME")
strPath = rs.Fields("FILE_PATH")
strPathNFile = strPath + strFile
rs.Edit
If ReadBLOB(strPathNFile, rs, "IMAGE") Then 'stores the binary data
see modBlob for ReadBLOB function
rs.Update 'update the record
MsgBox "row"+ i + "Success!", vbInformation
Else
MsgBox strPathNFile & "does not exist!", vbExclamation
End If
rs.MoveNext
Next i
rs.Close
db.Close
MsgBox "Congrates All done!"