require "dbi" require "win32ole" dbh=DBI.connect("DBI:ADO:Provider=SQLOLEDB.1;Data Source=.;Initial Catalog=pubs;User Id=sa;Password=root;") dbh.execute('select * from ...') dbh.commit dbh.disconnect
DBI.connect('dbi:ODBC:你的odbc库名','USERNAME','PASSWORD')