sqlanywhere / dbd-sqlanywhere

A driver that allows Ruby/DBI to communicate with SQL Anywhere
http://sqlanywhere.rubyforge.org/
Other
4 stars 3 forks source link

LoadError: Could not load SQLAnywhere DLL #1

Closed ondemannen closed 9 years ago

ondemannen commented 9 years ago

When trying to connect I get the error: LoadError: Could not load SQLAnywhere DLL

Are there any dependencies I need in order for this to work? I'm running Ruby 1.9.3p551 on a Redhat-server

ondemannen commented 9 years ago

Got a bit further. Downloaded the client from http://scn.sap.com/docs/DOC-35857 and installed it.

efarrar commented 9 years ago

Are you still getting the same error after installing the client libraries?

ondemannen commented 9 years ago

The error went away after the client was installed and I got the environment variables in place (on Linux). All I need to figure out now is to build the connect string correctly. I'm not near the code at the moment, and my DBI is kind of rusty, but would the connect string be something like this?

dbh = DBI.connect('DBI:SQLAnywhere:db=<db>;host=<host>;port=<port>;user=<user>;pwd=<pwd>')
ondemannen commented 9 years ago

I was writing a long dreary piece here about how things didn't work out. I complained about not knowing enough about SQLAnywhere until I came over this page:http://dcx.sybase.com/1200/en/dbadmin/how-introduction-connect.html

So I created a connection string and tested the following connect:

DBI.connect("DBI:SQLAnywhere:Host=<hostname:port>;DatabaseName=<dbn>",'<user>','<pass>')

Worked like a charm :)