0 Replies - 5294 Views - Last Post: 30 April 2008 - 07:06 PM Rate Topic: -----

#1 HellsBelle  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 30-April 08

How To Save Bitmap File as OLE Object in Access OLE Object Field

Posted 30 April 2008 - 07:06 PM

Hi,

I'm doing a visual basic 2005 form and binding it to an Access database. The database has a field for pictures in it. The pictures that are already loaded into the database show up fine in the VB form. But when I go to add a new row to the database it doesn't accept the picture into it, but only shows it in the form. Can someone tell me where I'm going wrong. Thanks for any help.


*** I guess this is what I'm really trying to do with the below code... Save Bitmap File as OLE Object in Access OLE Object Field


	Private Sub xAddNewButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xAddNewButton.Click

		'Adds a new record to the database

		Const EnterMsg As String = "Please enter a name: "
		Dim Name As String

		Name = Me.xNameTextBox.Text

		If Name = String.Empty Then
			MessageBox.Show(EnterMsg, "Pix", MessageBoxButtons.OK, MessageBoxIcon.Information)
		Else
			Me.PicturesBindingSource1.AddNew()

			'Opens dialog to browse for picture
			If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
				Me.xMyPictureBox.Load(OpenFileDialog1.FileName)			End If

		End If

		Me.xLookupBox.Focus()

	End Sub

This post has been edited by HellsBelle: 30 April 2008 - 09:08 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1