VB-ke-Microsoft Access

Z

zkai2000

Guest
Hi, aku ve menyimpan info profil saya bersama-sama dengan gambar.Mengapa itu tidak jadi ditampilkan dalam database (menggunakan Microsoft Access)?Gambar saya ditetapkan sebagai objek OLE di Microsoft Access

Ini adalah kode VB:private Sub cmdSave_Click ()savePicToDB picPhoto.Tag, rsUser ( "Foto")savePicToDB picFingerprint.Tag, rsUser ( "Sidik Jari")
rsUser.AddNewrsUser ( "Nama") = txtname.TextrsUser ( "IC Tidak") = txtIC.TextrsUser ( "Usia") = txtAge.TextrsUser ( "Jender") = txtGender.TextrsUser ( "Contact No") = txtContact.TextrsUser ( "Alamat") = txtAddress.TextrsUser ( "Email") = txtEmail.TextrsUser ( "Keterangan") = txtRemarks.Text
rsUser.Update
txtBoxLock (Benar)ctrlEnable (Benar)
cmdNew.SetFocusEnd Sub
Public Sub savePicToDB (ByVal picFile As String, ByVal fldPic Sebagai ADODB.Field)
Dim bBLOB () As ByteDim iNum As Integer
If (picFile <> "") Kemudian
iNum = FreeFile
Buka picFile Untuk Biner Sebagai # iNumRedIm bBLOB (FileLen (picFile))Dapatkan # iNum,, bBLOBClose # 1
'Simpan BLOBfldPic.AppendChunk bBLOBEnd If
End SubPublic Sub loadPicFromDB (ByVal fldPic Sebagai ADODB.Field, ByRef picTarget As PictureBox)
Dim sTempPic As StringDim lImgSize As LongDim lOffset As LongDim bChunck () As ByteDim iFile As IntegerConst CHUNKSIZE = 1000
sTempPic = App.Path & "\ temppic.jpg"Jika Len (Dir (sTempPic))> 0 ThenMembunuh sTempPicEnd If
iFile = FreeFile
Buka sTempPic Untuk Biner Sebagai # iFilelImgSize = fldPic.ActualSize
Do While lOffset <lImgSizebChunck () = fldPic.GetChunk (CHUNKSIZE)Letakkan # iFile,, bChunck ()lOffset = lOffset CHUNKSIZELoop
Close # iFile
Jika FileLen (sTempPic)> 0 ThenpicTarget.Picture = LoadPicture (sTempPic)LainpicTarget.Picture = NothingEnd If
Membunuh sTempPic
End SubDi mana masalahnya??
Thanks so much!!

 
hai
i think vb akses tidak dapat dibandingkan
baik yang dibuat khusus untuk melakukan STh
sampai jumpa

<img src="http://www.edaboard.com/images/smiles/icon_surprised.gif" alt="Surprised" border="0" />
 
nono .. i use microsoft access sebagai database.VB sebagai GUI.

jadi apapun info i key-in akan disimpan dalam akses

 
Anda dapat pergi ke www.planet-source-code.com untuk mendownload source code
pada akses database.AFAIK, itu cukup sederhana untuk memanipulasi AccessDB
dengan Visual Basic 6.

Mengapa tidak menggunakan XML, yang lebih mudah diakses dan lebih populer tentu saja.

 
Bahwa ritus.Anda dapat denda kode sumber ada atau u bisa lihat contoh di mana akses antarmuka menggunakan VB juga.

 

Welcome to EDABoard.com

Sponsor

Back
Top