<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">About 4-5 years ago I worked on an Intelli-sense type interactive input system<BR>for databases DB2, Mimer, MySQL and SQL Server that ran on Windows. I am now porting this, all other Windows projects and myself to Ubuntu.<BR><BR>Started porting the DB stuff about two weeks ago. Here are the connect calls on Windows, which I assumed would work Ubuntu under unixODBC. Only one did.<BR><BR>// first three parameters: dsn userid password<BR>connectSrv ( "MySQL_1" , "root" , "" , &sh )<BR>connectSrv ( "DB2_1" , "db2admin" , "abcd" , &sh )<BR>connectSrv ( "kenmimer" , "mimer_store" , "abcd" , &sh )<BR>connectSrv ( "ASA 9.0 Sample" , "" , "" , &sh )<BR><BR><BR><BR>I could connect to MySQL more or less right away, but spent about a week on DB2 and Mimer SQL. They both came up with SQLConnect error messages 'DB2_1 not a valid database
alias name' and 'kenmimer is not a valid database name'. On Windows I had been conditioned to think that a DSN is just an arbitrary shorthand notation for connection attributes passed from the application to the ODBC system via the SQLConnect, so I just could not understand why it did not work. As a last resort, I changed the DB2_1 dsn to SAMPLE, which is the name of the DB2 sample database. It worked. Mimer SQL worked too when I changed the kenmimer dsn to the name of Mimer's sample database.<BR><BR>MySQL_1 is not a name of one of MySQL's sample databases, but it worked. <BR><BR><BR>I have just managed to get SQL Anywhere to connect to its demo database using the following /etc/odbc.ini:<BR><BR>[SQL Anywhere 11 Demo]<BR>UserID=DBA<BR>Password=sql<BR>DatabaseFile=/home/ken/sa11_samples/sqlanywhere/demo.db<BR>ServerName=demo_ken<BR>StartLine=/opt/sqlanywhere11/bin32/dbeng11<BR>Description=SQL Anywhere 11 Sample
Database<BR>Driver=/opt/sqlanywhere11/lib32/libdbodbc11.so<BR><BR>It did not work when I put [sqlanywheredsn] into /etc/odbc.ini and into my SQLConnect call. Received message 'sqlanywhere not a dsn', so again, it seems the dsn has to be a database name.<BR><BR>What are the rules? The DSN can be an arbitrary string in MySQL, but has to be a databasename for the other databases. Is the decision made by unixODBC, the driver or both?<BR><BR>I really itching to understand this.<BR><BR><BR></td></tr></table><br>
<hr size=1> <a href="http://sg.rd.yahoo.com/aa/mail/domainchoice/mail/signature/*http://mail.promotions.yahoo.com/newdomains/aa/"> Get your new Email address! </a> <br>
Grab the Email name you've always wanted before someone else does!