Click to See Complete Forum and Search --> : CCommand::Open returning DB_E_NOTABLE with SQL Server


mistersulu
October 12th, 2005, 03:27 PM
Hey All:

I'm connecting to an SQL Server and attempting to get the data from a table using a SELECT query (with CCommand :: Open). With one catalog, I am able to get the data, and with another I get DB_E_NOTABLE. The only difference I can see between these two databases is the second table (the one that fails) belongs to a schema that is not 'db0'. Vis Studio .NET is able to open both databases and display data.

I'm calling CCommand :: Open() without any DBPROPSETs... I assume I need to setup something with a property set, but I have no clue exactly what to set (the MSDN is not too helpful). Unfortunately, I can't post my code here, but I have a feeling this is a very small, stupid problem.

Thanks in advance for all the help,
sulu

Siddhartha
October 12th, 2005, 03:40 PM
[ redirected ]

Regards,
Siddhartha

mistersulu
October 13th, 2005, 11:08 AM
Figured it out, thanks to the DBPROP_SCHEMAUSAGE property. For those interested, the proper way to formulate a table name, if table schema usage is specified, is [schema].[table] ... (ex. 'SELECT * FROM mySchema.myTable WHERE id = 1') ... probably old news to you high-end SQL folks, but, being a mostly simple Access stuff database coder, was a tough find.

Thanks all,
sulu