Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am a student,i do one sample project in vb.6 and access 2003.i designed one form for students entry,name and address, etc,this details are saved in database and retrive in my choice.
but i have plan to insert student pictrue in my 'students entry form'.i have no idea about this picture insertation.can u please help me, how to insert pictrue,how to stored in database,how to retrive photo on my search command.

i also attached my source code,module source code and screen shot of form.

yours faithfully
boby kuriakose



----------------------------------SOURCE CODE ENTRY FORM---------------------------------
VB
Dim rs As New ADODB.Recordset
Dim rs1 As New ADODB.Recordset
Dim rs2 As New ADODB.Recordset
Dim rs3 As New ADODB.Recordset
Dim rs4 As New ADODB.Recordset
Dim rs5 As New ADODB.Recordset
Dim i As Integer
Dim sngDailyRate As Single
Dim sngNumberOfDays As Integer
Dim sngHireCost As Single

Dim strLastName As String * 20
Dim strFirstName As String * 20
Dim s As String
Dim sql As String






Private Sub Form_Load()
sngDailyRate = 12.5
    sngNumberOfDays = 0
'    Days.Text = Format(sngNumberOfDays, "General Number")
    sngHireCost = 0
    strLastName = ""
    strFirstName = ""
    HireCost = Format(sngHireCost, "Currency")
Optname.Value = True
txtsrchname.Enabled = True
cmddelete.Enabled = False
--------------------MODULE SOURCE CODE------------

Option Explicit
Global cn As New Connection
Public Sub open_connection()
End Sub

Public Sub Main()
If cn.State Then cn.Close
cn.Open "microfox", "t", "a26yo1a01i0oo8Qr5ty51w521bipa"
frmSplash.Show
End Sub
Posted
Updated 28-May-13 8:31am
v2
Comments
[no name] 28-May-13 14:42pm    
As a student you should know the value of doing your own research, vbcity.com/forums/t/114098.aspx

1 solution

I do not recommend you to store images in a database, because of MS Access specifications and limitations[^].

Quote:
Microsoft Access is very inefficient at storing images in tables. A 50 kb jpg file can actually consume 1 Mb in an MDB

source: http://www.granite.ab.ca/access/imagehandling.htm[^]

I would suggest you to store images outside the database, for example in a specific folder. In MS Access database you should store image location only.

More about storing images in MS Access database:
Store images in a database[^]

If you need to store images in MS Access database, some example code, you'll find here: http://www.programmersheaven.com/mb/vba/314651/314651/saving-bmp-to-ole-field-in-microsoft-access/[^]. Remember, you're doing it on your own risk!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900