Dear sir,
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--------------------------------- - 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 cmdadd_Click()
-
cmddelete.Enabled = False
-
cmdadd.Enabled = True
-
cmdedit.Enabled = False
-
cmdsave.Enabled = True
-
cmdsearch.Enabled = True
-
txtregno.Text = ""
-
-
End Sub
-
-
Private Sub cmddelete_Click()
-
-
If rs3.State Then
-
rs3.Close
-
End If
-
-
sql = "delete from studentdetails where regno=" & Int(txtregno.Text) & ""
-
rs3.Open sql, cn, adOpenKeyset, adLockOptimistic
-
txtregno.Text = ""
-
-
DTPlearfrom.Enabled = False
-
DTPlearto.Enabled = False
-
MsgBox "DATA SUCCESS TO DELETE"
-
End Sub
-
-
Private Sub cmdedit_Click()
-
cmddelete.Enabled = False
-
cmdadd.Enabled = True
-
cmdedit.Enabled = False
-
cmdsave.Enabled = True
-
cmdsearch.Enabled = True
-
txtregno.Enabled = True
-
-
End Sub
-
-
Private Sub cmdsave_Click()
-
If rs4.State Then
-
rs4.Close
-
End If
-
-
sql = "delete from studentdetails where regno=" & Int(txtregno.Text) & ""
-
rs4.Open sql, cn, adOpenKeyset, adLockOptimistic
-
-
If rs.State Then
-
rs.Close
-
End If
-
-
sql = "select * from studentdetails where regno=" & 0 & ""
-
rs.Open sql, cn, adOpenKeyset, adLockOptimistic
-
If rs.RecordCount = 0 Then
-
With rs
-
-
.AddNew
-
!RegNo = txtregno.Text
-
-
End If
-
-
MsgBox "DATA SUCCESS TO SAVE"
-
-
.Update
-
End With
-
End If
-
txtregno.Text = ""
-
txtlearnearsno.Text = ""
-
-
End Sub
-
-
Private Sub cmdsearch_Click()
-
MSFlexGrid1.Rows = 1
-
MSFlexGrid1.Visible = True
-
If rs5.State Then
-
rs5.Close
-
End If
-
-
i = 1
-
MSFlexGrid1.TextMatrix(0, 0) = "RegNo"
-
MSFlexGrid1.TextMatrix(0, 1) = "NAME"
-
If Optname.Value = True Then
-
sql = "select * from studentdetails where name like '" & "%" & Trim(txtsrchname.Text) & "%" & "'"
-
rs5.Open sql, cn, adOpenKeyset, adLockOptimistic
-
While Not rs5.EOF
-
MSFlexGrid1.Rows = MSFlexGrid1.Rows + 1
-
MSFlexGrid1.TextMatrix(i, 0) = rs5.Fields!RegNo
-
MSFlexGrid1.TextMatrix(i, 1) = rs5.Fields!Name
-
-
rs5.MoveNext
-
i = i + 1
-
-
Wend
-
End If
-
End Sub
-
-
Private Sub Form_Load()
-
Optname.Value = True
-
txtsrchname.Enabled = True
-
cmddelete.Enabled = False
-
cmdadd.Enabled = True
-
cmdedit.Enabled = False
-
cmdsave.Enabled = False
-
cmdsearch.Enabled = True
-
MSFlexGrid1.ColWidth(0) = 0
-
MSFlexGrid1.Visible = False
-
-
-
-
End Sub
-
-
-
-
Private Sub MSFlexGrid1_DblClick()
-
Frame3.Visible = False
-
cmdedit.Enabled = True
-
cmddelete.Enabled = True
-
cmdadd.Enabled = True
-
cmdsave.Enabled = False
-
cmdsearch.Enabled = True
-
MSFlexGrid1.Visible = False
-
If rs2.State Then
-
rs2.Close
-
End If
-
-
sql = "select * from studentdetails where regno=" & Trim(MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 0)) & ""
-
rs2.Open sql, cn, adOpenKeyset, adLockOptimistic
-
If rs2.RecordCount > 0 Then
-
With rs2
-
-
-
txtregno.Text = .Fields!RegNo
-
-
-
-
-
End With
-
End If
-
txtregno.Enabled = False
-
-
End Sub
-
-
-
--------------------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
0 1253 Sign in to post your reply or Sign up for a free account.
Similar topics
by: Timin Uram |
last post by:
Can someone tell me how to write php code to save an image from the
internet to the server? For example, if there was a picture at
http://somepage.com/hello.jpg I want to write a php script that...
|
by: charsh |
last post by:
Hi,
I using the code below to draw a text in a pictureBox1.
//Start---------------------------------------------------------------
private void button1_Click(object sender, System.EventArgs e)...
|
by: Sam Jost |
last post by:
Bitmap.Save() does crash very often on Saving jpg's. It seems to dislike
pictures on a random basis, but when it dislikes a picture there is no way
around it.
Take for example the picture...
|
by: john woo |
last post by:
Hi
I'm not sure it's possible that using javascript to locate/get
components X|Y then other language, like java-jsp to save/retrive these
data.
For instance, a GUI presents a layout of...
|
by: 1388-2/HB |
last post by:
I've got a small sockets application where I communicate with a web server
via async sockets method.
Using the ASCIIEncoding Class, I convert strings to byte arrays (and vice
versa) in...
|
by: Filippo Bettinaglio |
last post by:
Hi,
C# 2005
I load a 24bit BMP image in a picture box, what i need to do is save a
8bits(256 color) of that image. How can i do it?
Many Thanks,
Filippo
|
by: Chetana |
last post by:
Hi ,
I want the asp.net code to upload the video file ,save it in sql
server and display it after retriving it .
Please let me know immidiately .
Thanks
|
by: hareldo |
last post by:
hi,
i wrote a code that open a picture and store it in a string.
then its save the base_64 of this string in a jpeg file and then i can
show this picture.
but i want to show this picture without...
|
by: manjunadha |
last post by:
I want the asp.net code to upload the video file ,save it in sql
server and display it after retriving it .plzzzz send me reply........very urgent for me.
Thnaks in Advance..
Regards,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |