J
Justin Emlay
My following code creates two records. How can I combine this code to not
only write both blobs to a single record but to ALSO write a another normal
string field to the same record (not inserted yet).
Help on either would be greatly appreciated!
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source='" & Application.StartupPath & "\access.mdb'")
Dim cmdLargeImage As New OleDbCommand("INSERT INTO ImageTable (Image_Data)
VALUES (@LargeImage)", con)
Dim cmdThumbnail As New OleDbCommand("INSERT INTO ImageTable
(Image_ThumbNail) VALUES (@Thumbnail)", con)
cmdLargeImage.CommandType = CommandType.Text
cmdThumbnail.CommandType = CommandType.Text
Dim prmPicLargeImage As New OleDbParameter
prmPicLargeImage.ParameterName = "@LargeImage"
prmPicLargeImage.OleDbType = OleDbType.Binary
prmPicLargeImage.Value = Thumbnail
cmdLargeImage.Parameters.Add(prmPicLargeImage)
Dim prmPicThumbnail As New OleDbParameter
prmPicThumbnail.ParameterName = "@Thumbnail"
prmPicThumbnail.OleDbType = OleDbType.Binary
prmPicThumbnail.Value = Thumbnail
cmdThumbnail.Parameters.Add(prmPicThumbnail)
con.Open()
cmdLargeImage.ExecuteNonQuery()
cmdThumbnail.ExecuteNonQuery()
Thanks again for any help!
only write both blobs to a single record but to ALSO write a another normal
string field to the same record (not inserted yet).
Help on either would be greatly appreciated!
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source='" & Application.StartupPath & "\access.mdb'")
Dim cmdLargeImage As New OleDbCommand("INSERT INTO ImageTable (Image_Data)
VALUES (@LargeImage)", con)
Dim cmdThumbnail As New OleDbCommand("INSERT INTO ImageTable
(Image_ThumbNail) VALUES (@Thumbnail)", con)
cmdLargeImage.CommandType = CommandType.Text
cmdThumbnail.CommandType = CommandType.Text
Dim prmPicLargeImage As New OleDbParameter
prmPicLargeImage.ParameterName = "@LargeImage"
prmPicLargeImage.OleDbType = OleDbType.Binary
prmPicLargeImage.Value = Thumbnail
cmdLargeImage.Parameters.Add(prmPicLargeImage)
Dim prmPicThumbnail As New OleDbParameter
prmPicThumbnail.ParameterName = "@Thumbnail"
prmPicThumbnail.OleDbType = OleDbType.Binary
prmPicThumbnail.Value = Thumbnail
cmdThumbnail.Parameters.Add(prmPicThumbnail)
con.Open()
cmdLargeImage.ExecuteNonQuery()
cmdThumbnail.ExecuteNonQuery()
Thanks again for any help!