HELP... Storing & retrieving images in MS Access to be used on VB

gen23
04-13-2004, 07:51 AM
I need to create a program wherein I must use only one form and an Access database to store images and information that I would retrieve during runtime. Since I'll be using only one form, if i click a certain button, an image and information should appear, and if I click a different one, another set of images & information must appear. But I don't really know how to do it and whenever I try, I usually get an error "object variable or with block variable not set." What should I do? :confused: :(

reboot
04-13-2004, 07:56 AM
Post the code you've tried so far.

gen23
04-13-2004, 10:04 AM
Private Sub cmdadd_Click()
If path = Empty Then
MsgBox "no path", vbCritical, "Warning!"
Else
With ado1.Recordset
.AddNew <-- error is always appearing here
.Fields(0).Value = Text1.Text
.Fields(1).Value = Image1.Picture
.Update
End With

End If
End Sub

Private Sub cmddelete_Click()
With ado1.Recordset
.Delete
End With
End Sub

Private Sub cmdfirst_Click()
With ado1.Recordset
.MoveFirst
Text1.Text = .Fields(0)
End With

path = Text1
Image1.Picture = LoadPicture(path)
Image1.Visible = True
End Sub

*These are the codes I've done so far... It's kinda short because I don't really know what to do...

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum