I am trying to connect an ADO control to a table at runtime. ClassWizard generated a wrapper class and I tried the following:


m_Adodc.SetConnectionString((LPCSTR)"ODBC;DSN=MQIS");
m_Adodc.SetUserName((LPCSTR)"vbocan");
m_Adodc.SetPassword((LPCSTR)"");
m_Adodc.SetCommandType(2); //Table
m_Adodc.SetRecordSource((LPCSTR)"_Prefix");




When running the program, the ADO control is disabled and the datagrid linked to it shows nothing. If I do the same operations at design time (setting properties from ADO's configuration panels) everything works ok.
Could someone tell me what's going on?
I am new to DB-programming in VC++, C++ Builder is so much easier...