Info. for Bill H and Doug

Results 1 to 2 of 2

Thread: Info. for Bill H and Doug

  1. #1
    Join Date
    Dec 1969

    Default Info. for Bill H and Doug

    Guys, its working !<BR><BR>This is the simplest code to use to insert the image into a db, ( if the picture already exists on your web server).<BR><BR><BR> &#060;%<BR>Dim cn<BR>Dim rs<BR>Dim mstream<BR><BR><BR>%&#062;<BR><BR><BR>&#060;%<BR>S et cn = Server.CreateObject("ADODB.Connection")<BR>cn.Open "Provider=SQLOLEDB;data Source=SQLSERVER;Initial Catalog = Personnel; User Id=sa; Password="<BR><BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR>rs.Open "tbltempphoto", cn, 2,2<BR><BR>Set mstream = Server.CreateObject("ADODB.Stream")<BR>mstream.Typ e = 1<BR>mstream.Open<BR>mstream.LoadFromFile "C:PersonnelAdminPersonnelPhoto1952.jpg"<BR>rs.Add New<BR>RS("ADID") = Request.Form("ADID")<BR>RS("Forename") = Request.Form("Forename")<BR>RS("Surname") = Request.Form("Surname")<BR>RS("Email") = Request.Form("Email")<BR>RS("PostTitle") = Request.Form("PostTitle")<BR>RS("Section") = Request.Form("Section")<BR>RS("ContractStatus") = Request.Form("ContractStatus")<BR>RS("CEnd_Date") = Request.Form("CEnd_Date")<BR>rs.Fields("photo").Va lue = mstream.Read<BR>rs.Update<BR><BR>rs.Close<BR>cn.Cl ose<BR>%&#062;<BR><BR>All I need to do now is make the mstream = to the photo path.<BR><BR><BR>Again thanks for the help today.<BR>Jamie.

  2. #2
    Join Date
    Dec 1969

    Default Glad to hear it...

    Good luck...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts