store photo to sql server database

Database to store the photo:-

Table:-actors

Front end:-

Methods to use:-

a. Register “photo.dll”.(Click Here to Download Photo.dll. After downloading extract it)

b. Design database.

c. Design front end.

d. Write code as below.

Codes:-

Dim cnph As New ADODB.Connection ‘connection variable

Dim rsph As New ADODB.Recordset ‘recordset for text box and photo

Dim phg As New getsaveph ‘for photoget

Dim fn As String ‘file name variable for common dialog

Private Sub Form_Load() ‘connection

With cnph

.Provider = “sqloledb.1″

.ConnectionString = “user id=sa;data source=cseclass;initial catalog=kaliwood”

.Open

End With

End Sub

Private Sub cmdbrowse_Click() ‘browse picture

cdimg.ShowOpen

fn = cdimg.FileName

imgpic.Picture = LoadPicture(fn)

End Sub

Private Sub cmdedit_Click() ‘updating with picturepicture

rsph.Update

rsph.Fields(0) = txtaid.Text

rsph.Fields(1) = txtname.Text

rsph.Fields(2) = txtdob.Text

rsph.Fields(3) = txtcontact.Text

phg.SavePicDb rsph, 4, fn

MsgBox “data are updated”

End Sub

Private Sub cmdfirst_Click() ‘movefirst

rsph.MoveFirst

Call dataget

End Sub

Private Sub cmdlast_Click() ‘move last

rsph.MoveLast

Call dataget

End Sub

Private Sub cmdnews_Click() ‘make blank for new

txtaid.Text = “”

txtname.Text = “”

txtdob.Text = “”

txtcontact.Text = “”

End Sub

Private Sub cmdopen_Click() ‘open data from database

If rsph.State = 1 Then rsph.Close

rsph.Open “select * from actors”, cnph, adOpenDynamic, adLockPessimistic

Call dataget

End Sub

Sub dataget() ‘data getting from the database in the frontend

txtaid.Text = rsph.Fields(0)

txtname.Text = rsph.Fields(1)

txtdob.Text = rsph.Fields(2)

txtcontact.Text = rsph.Fields(3)

imgpic.Picture = LoadPicture(phg.GetPicFromDb(rsph, 4))

End Sub

Private Sub cmdsaves_Click() ‘saving data into the data base

rsph.AddNew

Call datassave

phg.SavePicDb rsph, 4, fn

MsgBox “saved”

End Sub

Sub datassave() ‘saving data

rsph.Fields(0) = txtaid.Text

rsph.Fields(1) = txtname.Text

rsph.Fields(2) = txtdob.Text

rsph.Fields(3) = txtcontact.Text

End Sub

Private Sub Command6_Click() ‘moving data next

rsph.MoveNext

If rsph.EOF = True Then

MsgBox “not found”

rsph.MoveLast

Else

Call dataget

End If

End Sub

Private Sub Command7_Click() ‘moving data previously

rsph.MovePrevious

If rsph.BOF = True Then

MsgBox “sorry”

rsph.MoveFirst

Else

Call dataget

End If

End Sub

Related posts:

free download visual basic 6 black book including source code
iOS THE OS Killer Features OS Rater and iOS other Stars
code.org America learn their children programming
Get the most well-liked download wordpress plugin readily available today, you'll discover both free and premium plugins here. We have actually examined the entire web, reviewed hundreds of recommended Wordpress plugins and picked the very best.
Get technology related news the most recent modern technology headlines, consisting of new item launches, revenues figures and technician sector efficiency details. Review posts on new devices and prototypes for future modern technology.
small business seo people need to and should not be doing on your Websites to make them rate greater in online search engine. In a continuously changing SEO landscape, it is very important to continue to be current with the altering methods and techniques of optimization.
Here is a listing of system WordPress Management with a main location. There are WordPress dashboards, as well as multisite devices to take care of domains, themes, projects, and a lot more. includes one-click access, monitoring, data backup, implementation, posting, and security functions. Review which of your websites have styles and plugins that need focus. Along with one click, update every one of your plugins, styles or core WordPress software.


Hi, My Name is Sanjan Bikram. I am a Visual Interface Designer focusing on Web Applications design, WordPress/blogger development… I am also the founder and Chief-editor of XploringMinds.Com

Share This Post

Recent Articles

Leave a Reply

What is 14 + 7 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)
XploringMinds is on Wordpress CMS · Designed by BloggingTalks