Creating MyDAC components at runtime

Creating MyDAC components at runtime

Postby LarryEvilsizer » Fri 24 Feb 2006 00:21

Hi,

Please excuse this somewhat basic question - I come from a Java background where creating JDBC objects at run-time is OK and I was hoping to do the same with MyDAC.

When I try to create new TMyConnection and TMyQuery objects using the new operator, the compiler tells me there is no constructor for this operation. I guess I'm doing something wrong, but am not sure what it is.

I would appreciate any advice on how to create MyDAC objects at run-time. Thanks in advance.

Larry
LarryEvilsizer
 
Posts: 4
Joined: Fri 24 Feb 2006 00:13

Postby Antaeus » Fri 24 Feb 2006 08:12

I guess that you use CBuilder. To create MyDAC component you should use somethig like this:
Code: Select all
TMyQuery *MyQuery = new TMyQuery(NULL);

or
Code: Select all
TMyQuery *MyQuery = new TMyQuery(Form1);
Antaeus
 
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Postby LarryEvilsizer » Fri 24 Feb 2006 15:11

Thanks, Antaeus. That worked like a charm!

Larry
LarryEvilsizer
 
Posts: 4
Joined: Fri 24 Feb 2006 00:13


Return to MySQL Data Access Components