Dikode VBA nya kok tidak ditemukan rsparent.edit nya yah? Mhn dicek kembali.
--- In belajar-access@yahoogroups.com, <Narupi@...> wrote:
>
> Mas Sofyan dan semuanya,
>
> Terima kasih atas linknya. Saya sudah mencoba tapi selalu ada error no 3820 disaat proses "rsparent.edit"
> Mengapa ya. Berikut ini scriptnya
> ===
> On Error GoTo Err_SaveImage
>
> Dim db As DAO.Database
> Dim rsParent As DAO.Recordset2
> Dim rsChild As DAO.Recordset2
>
> Set db = CurrentDb
> Set rsParent = Me.Recordset
>
> rsParent.OpenRecordset
>
> Set rsChild = rsParent.Fields("AttachmentTest").Value
>
> rsChild.OpenRecordset
> rsChild.Fields("FileData").SaveToFile ("c:\")
>
> Exit_SaveImage:
> Set rsChild = Nothing
> Set rsParent = Nothing
> Exit Sub
>
> Err_SaveImage:
>
> If Err = 3839 Then
> MsgBox ("File Already Exists in the Directory!")
> Resume Next
>
> Else
> MsgBox "Some Other Error occured!", Err.Number, Err.Description
> Resume Exit_SaveImage
>
> End If
> ===
>
> Thanks and regards
>
> Narupi
> IFBT OP ATP PO DSO IEP SS
>
> From: belajar-access@yahoogroups.com [mailto:belajar-access@yahoogroups.com] On Behalf Of Sofyan Efendi
> Sent: Thursday, September 06, 2012 9:50 AM
> To: belajar-access@yahoogroups.com
> Subject: Re: [belajar-access] Re: Upload Attachment dengan Script
>
>
> Dear Mas Narupi, penjelasan mengenai data type attachment, salah satunya bisa kunjungi: http://www.access-freak.com/tutorials.html#Tutorial07
> Untuk melihat PDF di Access, bisa kunjungi webnya Mas Sumiyanto, berikut linknya: http://cakyanto.wordpress.com/2012/06/25/open-pdf-inside-access-form/
> Mungkin data type attachment lebih baik dari OLE Object, karena dengan attachment, kita bisa memasukan lebih dari satu file.
>
> Wassalaamu'alaikum Warahmatullahi Wabarakatuh,
> Sofyan Efendi
> http://imopi.wordpress.com | http://trendmuslim.com
> ----- Original Message -----
> From: Narupi@...<mailto:Narupi@...>
> To: belajar-access@yahoogroups.com<mailto:belajar-access@yahoogroups.com>
> Sent: Thursday, September 06, 2012 8:31 AM
> Subject: RE: [belajar-access] Re: Upload Attachment dengan Script
>
> Mas Sofyan dan semuanya,
>
> Saya sudah coba dan berhasil. Tapi ada beberapa hal lain yang jadi pertanyaan
>
> 1. Apa bedanya (kelebihannya) jika di banding metode attachment
>
> 2. Bagaimana untuk menampilkan semua halaman data yang attachment yang mana filenya itu lebih dari 1 halaman
>
> 3. Kalau untuk script upload attachment bagaimana ya?
> Maaf banyak sekali
>
> Thanks and regards
>
> Narupi
> IFBT OP ATP PO DSO IEP SS
>
> From: belajar-access@yahoogroups.com<mailto:belajar-access@yahoogroups.com> [mailto:belajar-access@yahoogroups.com]<mailto:[mailto:belajar-access@yahoogroups.com]> On Behalf Of Sofyan Efendi
> Sent: Monday, September 03, 2012 4:40 PM
> To: belajar-access@yahoogroups.com<mailto:belajar-access@yahoogroups.com>
> Subject: [belajar-access] Re: Upload Attachment dengan Script
>
>
>
> Dear Pak Narupi, untuk upload bisa menggunakan kode berikut:
>
> Public Function GetDataFromFile(FileName As String, fieldName As String) As Boolean
> Dim b() As Byte, i&, rst As DAO.Recordset, fLen&
> On Error GoTo err_GetDataFromFile
> fLen = FileLen(FileName)
> ReDim b(fLen - 1)
> Open FileName For Binary Access Read As #1
> Get #1, , b
> Set rst = CurrentDb.OpenRecordset("dbSetup")
> With rst
> If .RecordCount = 0 Then
> .AddNew
> Else
> .MoveFirst
> .Edit
> End If
> .Fields(fieldName).AppendChunk b
> .Update
> End With
> rst.Close
> Set rst = Nothing
> GetDataFromFile = True
> exit_GetDataFromFile:
> Set rst = Nothing
> Close
> Exit Function
> err_GetDataFromFile:
> GetDataFromFile = False
> Resume exit_GetDataFromFile
> End Function
>
> Contoh penggunaan:
>
> '?GetDataFromFile("E:\My Documents\opi.pdf","SetupFile")
> Akan memasukan file opi.pdf ke table "dbSetup" di field "SetupFile", dengan data type OLE Object.
>
> Wassalaamu'alaikum Warahmatullahi Wabarakatuh,
> Sofyan Efendi
> http://imopi.wordpress.com | http://trendmuslim.com
>
> --- In belajar-access@yahoogroups.com<mailto:belajar-access%40yahoogroups.com>, <Narupi@<mailto:Narupi@>> wrote:
> >
> > Mas Sofyan,
> >
> > Untuk filenya bertype attachment (.pdf)
> >
> > Thanks and regards
> >
> > Narupi
> > IFBT OP ATP PO DSO IEP SS
> >
> > From: belajar-access@yahoogroups.com<mailto:belajar-access%40yahoogroups.com> [mailto:belajar-access@yahoogroups.com<mailto:belajar-access%40yahoogroups.com>] On Behalf Of Sofyan Efendi
> > Sent: Monday, September 03, 2012 3:33 PM
> > To: belajar-access@yahoogroups.com<mailto:belajar-access%40yahoogroups.com>
> > Subject: Re: [belajar-access] RE: Upload Attachment dengan Script
> >
> >
> > Dear Pak Narupi, yg dimaksud upload attachment ini, apakah dimasukan ke field bertype attachment atau bertype OLE Object ya?
> >
> > Wassalaamu'alaikum Warahmatullahi Wabarakatuh,
> > Sofyan Efendi
> > http://imopi.wordpress.com | http://trendmuslim.com
> > ----- Original Message -----
> > From: Narupi@<mailto:Narupi@<mailto:Narupi@%3cmailto:Narupi@>...>
> > To: belajar-access@yahoogroups.com<mailto:belajar-access%40yahoogroups.com><mailto:belajar-access@yahoogroups.com<mailto:belajar-access%40yahoogroups.com>>
> > Sent: Thursday, August 02, 2012 7:28 AM
> > Subject: [belajar-access] RE: Upload Attachment dengan Script
> >
> > Hallo All,
> >
> > Ada yang bisa bantu masalah saya di bawah? Saya perlu sekali. Karena file yang mau di upload banyak dan rutinitas.
> >
> > Thanks and regards
> >
> > Narupi
> > IFBT OP ATP PO DSO IEP SS
> >
> > From: Narupi (IFBT OP BE POB LOG)
> > Sent: Thursday, July 26, 2012 12:42 PM
> > To: belajar-access@yahoogroups.com<mailto:belajar-access%40yahoogroups.com><mailto:belajar-access@yahoogroups.com<mailto:belajar-access%40yahoogroups.com>>
> > Subject: Upload Attachment dengan Script
> >
> > Hallo para access mania....
> > Langsung saja ya.
> > Saya mau mengupload attachment (pdf) kedalam data base dengan menggunakan VB. Bagaimana ya caranya?
> > Mengapa saya melakukan ini.
> >
> > 1. Karena file yang akan di upload lumayan banyak dan rutinitas
> >
> > 2. Karena file yang akan di upload harus menyesuaikan antara nama file dengan id yang ada di database.
> > Contohnya:
> > Saya mempunyai 10 file dengan nama 1,2,3 .. dst
> > Dan saya punya database dengan id 1,2,3 .. dst
> > Yang saya harapkan dengan cukup klick satu tombol maka akan upload file secara otomatis sesuai dengan id database.
> >
> > Thanks and regards
> >
> > Narupi
> > Infineon Batam
> >
>
Thursday, September 6, 2012
[belajar-access] Re: Upload Attachment dengan Script
__._,_.___
SPAM IS PROHIBITED
.
__,_._,___
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment