We help IT Professionals succeed at work.

No data displayed when project run!

Ianternet
Ianternet asked
on
Hi there, I have just started using Delphi again (my last project was with Delphi 3), and I am initially developing a very basic application using TPageControl and a few TabSheets.

I have set up a datamodule using an ADOConnection, ADOTable and a Datasource.  On my TabSheet, I have dropped a dbGrid component and connected it up to my datasource, set everything to live and the data displays.  However, as soon as I run the project the data does not display.

If I do the above, but have the ADO components etc on the Tabsheet, then everything works fine at run time as well.

So what am I doing wrong?

Also, I am wanting to use frames to split my code up into manageable units (which was the big problem in my previous developments), but the same thing happens when going the datamodule route.  However, if I try to put the ADO components onto the frame form and connect I get an error as follows:-

[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified

The ADO connection has been set up in exactly the same way.

Many thanks in advance for any help.

I am using Delphi v5 on a Windows 2000 PC.

Regards

Ian
Comment
Watch Question

well I have all the tables/connections closed
then open them at runtime manually
I also have the connections and some tables in a shared module
I have no problems doing it this way
it also helps having the connection string built manually if you have db's like MS Access and the directory they're in is not static or predefined

Author

Commented:
After much messing about and creating new applications, I finally found the problem....and please remember that it is years since I have programmed with Delphi.....I had forgotten to create the datamodule at run-time.  Once I had set the Autocreate form option on, everything worked like a peach.

Whoops!!!
Commented:
Ianternet has answered own question.  I will move this to PAQ to save the question, and will refund the points.

Regards,
ComTech
Community Support Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.