Unanswered: MS SQL Server Database Connection Problems
I can connect successfully to the Microsoft SQL Server "Beauty" (get also nonzero for successfull connection). If i run the application (see code below). I get following Error Message "Illegal Objectname 'TestTabelle' ". I double checked the SQL statement and it should be correct. Even the spelling of TestTabelle is right. For testing purposes I've also included 5-6 data records in the tabel.
I try to connect via ODBC. I've created the database with MS SQL Enterprise Manager. Right Click -> Create New Database. I called it "Test" and created in "Test" a new Table, which is called "TestTabelle".
I found information how i can connect to a ms sql server "Beauty", i've also found how i can connect to a table, BUT where is the information which Database ?`in my case it should be Test.
how can i setup a default database.... Cause in my application i can't access my Test Database..... See code below
Why is this code BOLD not working if i try to select a database ?
//CDatabase object "db" created to connect database
//CRecordset object "rs" created to access and manipulate database records.
CRecordset rs(&db); strcpy(sql_statement,_T("SELECT * FROM TestTabelle")); <- NOT WORKING... GETTING ERROR MESSAGE if i use this sql_statement " USE TEST; SELECT * FROM TestTabelle"
//Get quantity from Database
int n = rs.GetODBCFieldCount( );
for( int i = 0; i < n; i++ )