Advertisement
2002C Databases/ Data Access/ DAO/ ADO #10237

PRINT AN IMAGE TO A DATA REPORT VIA ADO

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.

AI

AIサマリー: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ソースコード
original-source
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 
オリジナルのコメント (3)
Wayback Machineから復元