Hi guys !

I have big problem in my project i cant display the data of my database (.mdb) to my Data report i need some expert help to this. Im new to this im such a loooooser... plss help me

Thanks in advance..

Dani AI

Generated

Good that ’s design‑time fix worked for . Below are concise, durable tips that extend that solution: runtime binding patterns, quick troubleshooting checks for an “empty” DataReport, and deployment gotchas that often bite later.

A robust runtime pattern is to set the DataEnvironment connection to the actual MDB path at startup (use App.Path), close/re‑execute any command rowsets so they use the new connection, then preview the report. Example pattern (adjust names to the project):

' runtime: point the DataEnvironment to the EXE folder and rebind the command
Dim dbPath As String
dbPath = App.Path & "\MyData.mdb"

With DataEnvironment1.Connection1
  If .State <> 0 Then .Close
  .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbPath & ";Persist Security Info=False;"
  .Open
End With

If DataEnvironment1.rsMyCmd.State <> 0 Then DataEnvironment1.rsMyCmd.Close
DataEnvironment1.MyCmd   ' re-execute the command rowset so it uses the new connection

Binding the report directly to an ADODB.Recordset at runtime is an alternative when the SQL is dynamic or filters are applied in code: open a client‑side recordset (e.g., adOpenStatic), Set DataReport1.DataSource = rs and set DataReport1.DataMember = ""; make sure each report textbox’s DataField matches the recordset fields and that the report’s design‑time DataSource is cleared first. (stackoverflow.com)

Quick troubleshooting checklist and deployment notes:

  • Confirm the source table/query actually has rows and the report doesn’t include a saved filter that hides records. (support.microsoft.com)
  • Use the Jet provider for .mdb files (Microsoft.Jet.OLEDB.4.0) and test the provider on target machines; if the file is .accdb install the Access Database Engine (ACE) appropriate to the app bitness. (learn.microsoft.com)
  • For portability, prefer setting connections at runtime or binding a runtime recordset rather than hard‑coding design‑time paths. (daniweb.com)

These steps make the report portable and reduce “works on my PC” surprises when moving the EXE or updating the database file.

Recommended Answers

All 3 Replies

I give you a very simple way. at 1st click on project menu_Add Data Environment. Double click on Data Environment1. click right mouse on connection1 & then click properties. In Provider tab click on Microsoft Jet 4.0 OLE DB Provider. Click next. select the database. you can test connection in below. click ok.
click right mouse on connection1 & click add command. again click right mouse on command1. go properties. in database object_select table. In object name_ select table name. click ok.
2. click on project menu_Add Data Report. select the data report. go properties. In Data source select Data Environment1. In Data member select Command1.
3. put a text box (Rpt textbox, in Data report) in detail (Section1) in data report. select the text box. go properties. in data member select command1. in data field_select any.
4. in form1 put a command button and then write

Private Sub Command1_Click()
DataReport1.Show
End Sub

you can get many sample in search engine. try ...

I give you a very simple way. at 1st click on project menu_Add Data Environment. Double click on Data Environment1. click right mouse on connection1 & then click properties. In Provider tab click on Microsoft Jet 4.0 OLE DB Provider. Click next. select the database. you can test connection in below. click ok.
click right mouse on connection1 & click add command. again click right mouse on command1. go properties. in database object_select table. In object name_ select table name. click ok.
2. click on project menu_Add Data Report. select the data report. go properties. In Data source select Data Environment1. In Data member select Command1.
3. put a text box (Rpt textbox, in Data report) in detail (Section1) in data report. select the text box. go properties. in data member select command1. in data field_select any.
4. in form1 put a command button and then write

Private Sub Command1_Click()
DataReport1.Show
End Sub

you can get many sample in search engine. try ...

Thanks to this it works..

if this solve your problem then please mark it as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.