keep gettting errors using Sequel ODBC::Error: 37000 (170)

J

Junkone

i am trying to connect to MSSQL server from xP


i have the following problem for any sql. pl help
ODBC::Error: 37000 (170) [Microsoft][ODBC SQL Server Driv
er][SQL Server]Line 1: Incorrect syntax near '1'.



D:\Documents and Settings\>irb
irb(main):001:0> require 'odbc'
=> true
irb(main):002:0> require 'Sequel'
=> true
<c('LPM', :user=>'resum', :password=>'ms_0416')
=> #<Sequel::ODBC::Database: "odbc:resum:ms_04166@/LPM">
irb(main):004:0> require 'rubygems'
=> false
irb(main):005:0>
a=Sequel.odbc('LPM', :user=>'resum', :password=>'ms_04166>
=> #<Sequel::ODBC::Database: "odbc:resum:ms_0416@/LPM">
irb(main):007:0> a.connect('LPM')
=> #<ODBC::Database:0x2d54990>
irb(main):008:0> a.tables
Sequel::NotImplemented: #tables should be overridden by adapters
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/database
/query.rb:185:in `tables'
from (irb):8
irb(main):009:0>
ds=Sequel.odbc('LPM', :user=>'resum', :password=>'ms_0416>
=> #<Sequel::ODBC::Database: "odbc:resum:ms_04166@/LPM">
irb(main):010:0> ds.connect('LPM')
=> #<ODBC::Database:0x35e5e10>
irb(main):011:0>
DB=Sequel.odbc('LPM', :user=>'resum', :password=>'ms_0416>
=> #<Sequel::ODBC::Database: "odbc:resum:ms_04166@/LPM">
irb(main):012:0> DB.connect('LPM')
=> #<ODBC::Database:0x35ae1c0>
irb(main):013:0> ds=DB[:problemTable]
=> #<Sequel::ODBC::Dataset: "SELECT * FROM \"PROBLEMTABLE\"">
irb(main):014:0> ds.count
Sequel::DatabaseError: ODBC::Error: 37000 (170) [Microsoft][ODBC SQL
Server Driv
er][SQL Server]Line 1: Incorrect syntax near '1'.
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/adapters
/odbc.rb:52:in `run'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/adapters
/odbc.rb:52:in `execute'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/database
/logging.rb:28:in `log_yield'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/adapters
/odbc.rb:52:in `execute'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/connecti
on_pool/threaded.rb:84:in `hold'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/database
/connecting.rb:226:in `synchronize'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/adapters
/odbc.rb:50:in `execute'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/dataset/
actions.rb:541:in `execute'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/adapters
/odbc.rb:92:in `fetch_rows'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/dataset/
actions.rb:123:in `each'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/dataset/
actions.rb:449:in `single_record'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/dataset/
actions.rb:457:in `single_value'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/dataset/
actions.rb:202:in `get'
from C:/Ruby187/lib/ruby/gems/1.8/gems/sequel-3.23.0/lib/
sequel/dataset/
actions.rb:96:in `count'
from (irb):14
from :0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

dbi help required 0
ruby/sequel/mysql problem 1
ANN: Sequel 3.21.0 Released 0
ODBC query 0
Help with gem ruby mysql error 10
Sequel 2.1 and Windows 2
ANN: Sequel 3.9.0 Released 0
ANN: Sequel 3.12.0 Released 0

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top