Invalid Object Name Odbc Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn odbc invalid object name '# more about Stack Overflow the company Business Learn more about hiring developers or microsoft sql server native client 10.0 sql server invalid object name posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow sqlstate 42s02 invalid object name Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up SQL SERVER ODBC ERROR(Invalid object name) but when I microsoft odbc sql server driver sql server invalid column name add in SQL query mydb.dbo.mytable all works fine up vote 5 down vote favorite 2 I have an old asp.net 1 project (it works fine on old server, mytable exist in db. Now I am trying to upgrade it to asp.net 4 My connection string is:
Error 42s02 Microsoft Odbc Excel Driver
* from mytable", dataConnection); dataCommand.CommandTimeout = 900; OdbcDataReader dataReader = dataCommand.ExecuteReader(CommandBehavior.CloseConnection); When I wrote SQL as select * from mydb.dbo.mytable all works fine What I should change in db settings (security, schema, dbo) or in connection string? sql-server schema odbc connection-string share|improve this question edited Sep 21 '11 at 21:18 marc_s 453k938691032 asked Sep 21 '11 at 17:28 John 5321825 Just always specify the schema - e.g. use dbo.MyTable instead of just MyTable - so try select * from dbo.mytable - does that work? –marc_s Sep 21 '11 at 21:21 it is not good way,because i should rewrite a lot of sql queries –John Sep 22 '11 at 9:25 add a comment| 1 Answer 1 active oldest votes up vote 10 down vote accepted My guess, seeing that you're using ODBC, is that your ODBC connection doesn't specify a default database, and so it's using master. You can either: specify the database in your connection string using "Database=myDBname" or "InitialCatalog=myDBname" change the default database in your ODBC connection, as shown here in XP/Server 2003 share|improve this answer answered Sep 21 '11 at 19:18 John N 1,3751119 1 Thanks! I was receiving a similar error (it intermitt
360 games PC games
Sqlstate 42s02 Sql Error Code 208
Windows games Windows phone games Entertainment All Entertainment invalid object name in sql server 2012 Movies & TV Music Business & Education Business Students & educators "invalid object name 'django_session'" Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet http://stackoverflow.com/questions/7504006/sql-server-odbc-errorinvalid-object-name-but-when-i-add-in-sql-query-mydb-dbo Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All https://support.microsoft.com/en-us/kb/966271 Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
object name - ASP Hi, I am able to retrieve data from database and then the object name is fine, say SELECT * FROM problemdb, but when I try to use INSERT, I get the error http://www.justskins.com/forums/microsoft-odbc-sql-server-86137.html in subject. The access rights are enough, as far as I can see, and the error only comes from ASP page, not when I do it with windows scripting host (or cscript). I use the following command in ASP, is it ok? <% set Conn = CreateObject ("ADODB.connection") Conn.Open "driver={SQL Server};server=ip.ad.re.ss;uid=myself;pwd=mypasswd ;database=mydatabase" %> So I explicitely connect to the database I want to. Could anyone say what's the invalid object ... Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode February 13th,03:15 PM #1 [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name Hi, I am able to retrieve data from database and then the object name is fine, say SELECT * FROM problemdb, but when I try to use INSERT, I get the error invalid object name in subject. The access rights are enough, as far as I can see, and the error only comes from ASP page, not when I do it with windows scripting host (or cscript). I use the following command in ASP, is it ok? <% set Conn = CreateObject ("ADODB.connection") Conn.Open "driver={SQL
Server};server=ip.ad.re.ss;uid=myself;pwd=mypasswd ;database=mydatabase" %> So I explicitely connect to the database I want to. Could anyone say what's the problem? I think it might be the connection I'm using... I've seen it done differently, but this works The SQL server is in the same server as the IIS where I run the pages. Thanks for the help. Nico Leiska Guest Reply With Quote February 13th,03:47 PM #2 Re: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name Nico Leiska"