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

Discussion in 'Ruby' started by Junkone, May 25, 2011.

  1. Junkone

    Junkone Guest

    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
    Junkone, May 25, 2011
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Drew Volpe
    Replies:
    0
    Views:
    347
    Drew Volpe
    Nov 25, 2003
  2. Ameur

    Gettting xml column data

    Ameur, Nov 19, 2008, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    671
    Ameur
    Nov 20, 2008
  3. Sharon Rosner
    Replies:
    0
    Views:
    133
    Sharon Rosner
    Apr 16, 2007
  4. Matthew Moss

    [QUIZ] Records and Arrays (#170)

    Matthew Moss, Jul 18, 2008, in forum: Ruby
    Replies:
    12
    Views:
    332
    SHINDO Motoaki
    Jul 22, 2008
  5. Matthew Moss

    [SUMMARY] Records and Arrays (#170)

    Matthew Moss, Jul 24, 2008, in forum: Ruby
    Replies:
    0
    Views:
    107
    Matthew Moss
    Jul 24, 2008
Loading...

Share This Page