How to specify username and password when connect to ODBC using kdb+ as a client?

682 views
Skip to first unread message

bovine

unread,
Oct 18, 2010, 10:24:44 PM10/18/10
to Kdb+ Personal Developers
Basically I was trying to connect to some database within kdb+
following the instructions here:
https://code.kx.com/trac/wiki/Cookbook/ODBC/qclient

But when I doing the open or load like:
q)h:.odbc.open `northwind / open northwind database

I got an error message said:
'28000 [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
user ''.
The user is not associated with a trusted SQL Server connection.

Anyone can tell me how to specify the username and password for that
DSN? Thanks in advance!

hlivni

unread,
Oct 20, 2010, 1:50:47 PM10/20/10
to Kdb+ Personal Developers
I believe you have to specify a dsn or a connection string
to .odbc.open
I don't have much experience with DSNs, but if you use a connection
string, it would look something like this:
"Driver=<DRIVER
NAME>;Database=master;port=1433;Server=<YOUR_SQL_SERVER>;uid=<USER>;PWD=<PASSWORD>"

Luc MICHEL

unread,
Jun 25, 2012, 2:46:02 PM6/25/12
to personal...@googlegroups.com
Hi,

How about

h: .odbc.open "Driver={SQL Server};Server=servername;Database=dbname;Uid=user;Pwd=pass"

Name of the driver should have the right spelling.
Drivers are usually enclosed in curly brackets. 

regards,


On Mon, Jun 25, 2012 at 6:18 PM, Jack <captain.i...@gmail.com> wrote:
Hi,
 
To resurrect an old thread..
 
I am trying to connect to SQL Server with a connection string in the format above. When I connect using a DSN there is no problem, however using the connection string as above i get the message "[unixODBC][Driver Manager]Data source name not found, and no default driver specified"
 
So basically..
h:.odbc.open"dsn=dsnname;uid=user;pwd=pass" - works fine.
 
h:.odbc.open"driver=drivername;server=servername;database=dbname;uid=user;pwd=pass" - returns the error.
 
And the parameters used are the same as those in the .ini file.

Any thoughts as to why this isn't working for me?

Thanks

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/personal-kdbplus/-/c09QFckbx7EJ.
To post to this group, send email to personal...@googlegroups.com.
To unsubscribe from this group, send email to personal-kdbpl...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=en.

Reply all
Reply to author
Forward
0 new messages