SQL Server And CRecordSet... show me the tables! 
Author Message
 SQL Server And CRecordSet... show me the tables!

Hi,

I am new to the Database scene, so please bare with me.

We've created a small database in SQL Server with approx 18 tables, each of which
my MFC program needs to update.

I can conncet to the database, using CDatabase and the OpenEx() method... however
it is when I get to the RecordSets that mess me over.

The student registration sample was nice, and when I derived a new class, the
tables from the .mdb file showed up nicely....

However, this is quite different in the MS SQL Server scene. I properly set up
the ODBC driver and connected to the database... that's when things were weird.
The class wizard comes up with very strange names such
as "INFORMATION_SCHEMA.COLUMNS" and "dbo.dtproperties". These names are very far
from the names of the tables.

What gives?

I'm still doing tests... and might end up protyping most of the system in MS
ACCESS (not what we want to do).

Any stories, hints, articles etc would be appreciated.

Thanks
-Chris Adamson



Sun, 20 Jul 2003 08:13:22 GMT  
 SQL Server And CRecordSet... show me the tables!

Quote:

>However, this is quite different in the MS SQL Server scene. I properly =
>set up=20
>the ODBC driver and connected to the database... that's when things were =
>weird.
>The class wizard comes up with very strange names such=20
>as "INFORMATION_SCHEMA.COLUMNS" and "dbo.dtproperties". These names are =
>very far=20
>from the names of the tables.

These tables also exist in an SQL server set-up. Effectively, they're
the tables SQL uses to look after the database. You don't normally see
them, so I guess you're logged in as administrator/owner/superuser
(whatever the correct title is). Regardless, you should see the tables
you're after somewhere in the list, probably prefixed with "dbo.",
which just shows that they're owned by user "dbo".

HTH

Paul.
-------------------------------------------
Expressed opinions are usually my own.
Especially if they're any good (of course).
-------------------------------------------



Sun, 20 Jul 2003 22:17:09 GMT  
 SQL Server And CRecordSet... show me the tables!
These are system tables/system views of any SQL Server db. You can just
ignore them.. and look for user tables/views. IIRC, there's a checkbox
somewhere when setting up DSN that allow you to choose 'not' showing system
tables.


Hi,

I am new to the Database scene, so please bare with me.

We've created a small database in SQL Server with approx 18 tables, each of
which
my MFC program needs to update.

I can conncet to the database, using CDatabase and the OpenEx() method...
however
it is when I get to the RecordSets that mess me over.

The student registration sample was nice, and when I derived a new class,
the
tables from the .mdb file showed up nicely....

However, this is quite different in the MS SQL Server scene. I properly set
up
the ODBC driver and connected to the database... that's when things were
weird.
The class wizard comes up with very strange names such
as "INFORMATION_SCHEMA.COLUMNS" and "dbo.dtproperties". These names are very
far
from the names of the tables.

What gives?

I'm still doing tests... and might end up protyping most of the system in MS
ACCESS (not what we want to do).

Any stories, hints, articles etc would be appreciated.

Thanks
-Chris Adamson



Sun, 20 Jul 2003 23:51:38 GMT  
 SQL Server And CRecordSet... show me the tables!
Thank you Chu and Paul for some guidance.

I've been set up with the following rights according to SQL server:
-public
-data read
-data write

As per the last message I wrote, my rights were only public.

With the change, I get more tables, but none that look like the tables we
want!
Most of the names are: dbo.spt_datatype_info, dbo.spt_values,
dbo.spt_provider_types, dbo.sysalternates and then several
INFORMATION_SCHEMA....

Do I need more access rights? Do I have to specify a filename for the
database (I'm setting up the ODBC driver with the user DSN  and there is an
option for a filename, and I do not see a checkbox for hiding system
tables)?

Suggestions?

Thanks
-Chris


Quote:
> These are system tables/system views of any SQL Server db. You can just
> ignore them.. and look for user tables/views. IIRC, there's a checkbox
> somewhere when setting up DSN that allow you to choose 'not' showing
system
> tables.



> Hi,

> I am new to the Database scene, so please bare with me.

> We've created a small database in SQL Server with approx 18 tables, each
of
> which
> my MFC program needs to update.

> I can conncet to the database, using CDatabase and the OpenEx() method...
> however
> it is when I get to the RecordSets that mess me over.

> The student registration sample was nice, and when I derived a new class,
> the
> tables from the .mdb file showed up nicely....

> However, this is quite different in the MS SQL Server scene. I properly
set
> up
> the ODBC driver and connected to the database... that's when things were
> weird.
> The class wizard comes up with very strange names such
> as "INFORMATION_SCHEMA.COLUMNS" and "dbo.dtproperties". These names are
very
> far
> from the names of the tables.

> What gives?

> I'm still doing tests... and might end up protyping most of the system in
MS
> ACCESS (not what we want to do).

> Any stories, hints, articles etc would be appreciated.

> Thanks
> -Chris Adamson



Tue, 22 Jul 2003 02:01:43 GMT  
 SQL Server And CRecordSet... show me the tables!
Ooops!

I found a drop down list box in the Visual C++ wizard that allowed me access
to the correct set of tables.

From the advice given to me, I was under the impression that this option was
available during DSN setup.

It is resolved.

Thanks
-Chris Eh?



Tue, 22 Jul 2003 02:57:34 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. SQL Server with CDatabase/CRecordset and server cursors

2. CRecordset and SQL Server Linked Server View

3. Error updating SQL-Server record via ODBC (CRecordset)

4. How to pass NULL params in RFX for CRecordset in SQL Server/ODBC

5. CRecordset & SQL Server

6. Help! CRecordset/SQL Server 6.5

7. CRecordset & SQL Server speed issues

8. Dynaset with Bookmarks to SQL Server connection makes a CRecordset connection read-only

9. CRecordset updateable join with SQL Server 7.0

10. CRecordset: Error when adding records SQL Server view

11. Help: Problems with CRecordset and SQL Server

12. SQL Server error when updating via CRecordset

 

 
Powered by phpBB® Forum Software