Hi Guys Newbie to Ruby on Rails here, Just having a problem with MS SQL and RonR. I have setup everything as documented on the wiki page for sql server setup development: adapter: sqlserver database: nomiect host: DBI:ADO:Provider=SQLOLEDB;Data Source=XXXXXXXX;Initial Catalog=nomiect;User Id=nomi;Password=n0m1; username: nomi password: n0m1 I havent put in the real ip address. Okay so now i create all relevant view files etc. when i start the server no problems but when i go to the list action i get ActiveRecord::StatementInvalid (Execute OLE error code:80040E37 in Microsoft OLE DB Provider for SQL Server Invalid object name ''ect_res_customers''. HRESULT error code:0x80020009 Exception occurred.: SELECT COUNT(*) FROM ect_res_customers ): i think its because the owner has not bee specified? ie. snytax should be NOMIECT.dbo.ect_res_customers but how do i do that? I used scaffold to create the actions. Can anyone help? Thanks Rich
Two things... One, your config looks to complicated. Here is mine: development: adapter: sqlserver database: depotfinal_development host: HTPLAP2\BARKERLAP - this is the name of the database server you want to hit. typically the name of your box if you are hitting it locally username: username password: pwd1234 Two, make sure your user is a datareader/datawriter for the database. Mine are all setup as dbowner roles so you may need to bump them up to an owner to get all of the testing functionality to work. Ken On 8/22/05, Richard Walton <Richard.Walton-h1wxnS6SGOYRYyTu6r09QA@public.gmane.org> wrote:> > Hi Guys > > Newbie to Ruby on Rails here, > Just having a problem with MS SQL and RonR. > I have setup everything as documented on the wiki page for sql server > setup > development: > adapter: sqlserver > database: nomiect > host: DBI:ADO:Provider=SQLOLEDB;Data Source=XXXXXXXX;Initial > Catalog=nomiect;User Id=nomi;Password=n0m1; > username: nomi > password: n0m1 > > > I havent put in the real ip address. > > Okay so now i create all relevant view files etc. > when i start the server no problems but when i go to the list action i get > ActiveRecord::StatementInvalid (Execute > OLE error code:80040E37 in Microsoft OLE DB Provider for SQL Server > Invalid object name ''ect_res_customers''. > HRESULT error code:0x80020009 > Exception occurred.: SELECT COUNT(*) FROM ect_res_customers ): > > i think its because the owner has not bee specified? ie. snytax should be > NOMIECT.dbo.ect_res_customers but how do i do that? > I used scaffold to create the actions. > > Can anyone help? > Thanks > Rich > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
You are using the Rails 1.12.x configuration setup. This changed in Rails 1.13.1. It''s not your fault... I think the only note on this I found was in the newsgroup. Docs will probably reflect newer later. The SqlServerAdapter has been modified to allow the simpler use of the configuration in database.yaml. Now, just fill in the blanks, the sqlserveradapter will build the DBI string correctly from the needed information. Regards. Peter J. Fitzgibbons Applications Manager Lakewood Homes - "The American Dream Builder"(r) Peter.Fitzgibbons-STCS76aLmhk1y/cD6r8xzl6hYfS7NtTn@public.gmane.org (847) 884-8800 ________________________________ From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Ken Barker Sent: Monday, August 22, 2005 6:43 AM To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails] Microsft SQL Server Problems Two things... One, your config looks to complicated. Here is mine: development: adapter: sqlserver database: depotfinal_development host: HTPLAP2\BARKERLAP - this is the name of the database server you want to hit. typically the name of your box if you are hitting it locally username: username password: pwd1234 Two, make sure your user is a datareader/datawriter for the database. Mine are all setup as dbowner roles so you may need to bump them up to an owner to get all of the testing functionality to work. Ken On 8/22/05, Richard Walton <Richard.Walton-h1wxnS6SGOYRYyTu6r09QA@public.gmane.org> wrote: Hi Guys Newbie to Ruby on Rails here, Just having a problem with MS SQL and RonR. I have setup everything as documented on the wiki page for sql server setup development: adapter: sqlserver database: nomiect host: DBI:ADO:Provider=SQLOLEDB;Data Source=XXXXXXXX;Initial Catalog=nomiect;User Id=nomi;Password=n0m1; username: nomi password: n0m1 I havent put in the real ip address. Okay so now i create all relevant view files etc. when i start the server no problems but when i go to the list action i get ActiveRecord::StatementInvalid (Execute OLE error code:80040E37 in Microsoft OLE DB Provider for SQL Server Invalid object name ''ect_res_customers''. HRESULT error code:0x80020009 Exception occurred.: SELECT COUNT(*) FROM ect_res_customers ): i think its because the owner has not bee specified? ie. snytax should be NOMIECT.dbo.ect_res_customers but how do i do that? I used scaffold to create the actions. Can anyone help? Thanks Rich _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails