Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 ODBC Connection

Author  Topic 

suzie
Starting Member

15 Posts

Posted - 2010-06-29 : 04:38:54
Dear friends,
we have an SQL Server Enterprise manager running on microsoft windows server 2003,
we have a database created on this SQL, from where we read our data for our online site,
Now I have created a new database under the current one, but when I connect to it odbc_connect() I receive the following Error:

Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\wamp\www\Annahar_website\New-BackOffice\Annahar_backOffice\artic_update.php on line 16

I added the database to Data sources ODBC, connection to database works now
but now am receiving:

SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Could not truncate table 'artic' because this table does not exist in database 'master'., SQL state S0002 in SQLExecDirect in

SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'artic'., SQL state S0002 in SQLExecDirect in

artic is a table in new_temp database

please any help

why it cannot truncate a table in this database
??
thank you

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-29 : 04:45:28
your connection isn't pointing to the new database. It is pointing to the 'master' database (as default I think) and there isn't the table that you want to truncate.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

suzie
Starting Member

15 Posts

Posted - 2010-06-29 : 04:51:16
so what shall i do?
Go to Top of Page

suzie
Starting Member

15 Posts

Posted - 2010-06-29 : 04:54:03
ok, I put new_temp as default, and I get rid from this message thanks a lot
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-29 : 05:06:29
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -