|
-
Apr 29th, 2001, 07:54 PM
#1
Thread Starter
PowerPoster
Set the image boxes datasource and datafield to the datacontrol your using in vb!
Be back to give example! soon
-
Apr 29th, 2001, 09:30 PM
#2
Thread Starter
PowerPoster
OK Example:
Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;" & _
"Data Source= DATABASE NAME HERE"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "TABLE NAME HERE", cn, adOpenKeyset, adLockPessimistic, adCmdTable
PopulateFields
end sub
Public Sub PopulateFields()
If Not (rs.BOF And rs.EOF) Then
txtDescription.Text = rs.Fields("Description")
Set Image1.DataSource = rs
Image1.DataField = "Picture"
End If
End Sub
hope it helps!
-
Apr 30th, 2001, 08:52 AM
#3
I get this error message:
Unable to bind to field or datamember: 'FIELD NAME'
what's lacking?
Thanks dude!
-
Apr 30th, 2001, 09:00 PM
#4
Thread Starter
PowerPoster
In this:
Public Sub PopulateFields()
If Not (rs.BOF And rs.EOF) Then
txtDescription.Text = rs.Fields("DB FIELD NAME") 'this is not needed i have it in mine for a description of the pic!
Set Image1.DataSource = rs
Image1.DataField = "DB OLE FIELD NAME"
End If
End Sub
Let me know!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|