VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



PRINT AN IMAGE TO A DATA REPORT VIA ADO

by Walter Narvasa (15 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (8 Votes)

Im sick and tired of using a third party report generator such as Crystal Reports, etc. so what i did was i mastered Data Report of Visual Basic 6 and here is sample of how to print an image to Data Report using ADO Connections. I hope you like this sample of mine.

Rate PRINT AN IMAGE TO A DATA REPORT VIA ADO

dim rs as ADODB.Recordset
dim db as ADODB.Connection
dim xDataPath as String
dim xPeoplePicture as String
xDataPath = App.Path & "\Database\Test.MDB"
db.CursorLocation = adUseClient
db.Open "PROVIDER=MSDataShape;Data PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & xDataPath
Set rs = New Recordset
rs.Open "SELECT People_Name, People_Picture FROM People ORDER BY People_Name;", db, adOpenStatic, adLockOptimistic
rs.Movefirst
xPeoplePicture = rs!People_Picture ' "\SAMPLE.JPG" <-Sample Contents of rs recordset
Set DataReport1.DataSource = rs
Set DataReport1.Sections(3).Controls("Image1").Picture = LoadPicture( App. Path & xPeoplePicture) 
DataReport1.Show 

Download this snippet    Add to My Saved Code

PRINT AN IMAGE TO A DATA REPORT VIA ADO Comments

No comments have been posted about PRINT AN IMAGE TO A DATA REPORT VIA ADO. Why not be the first to post a comment about PRINT AN IMAGE TO A DATA REPORT VIA ADO.

Post your comment

Subject:
Message:
0/1000 characters