ORA-06401: NETCMN: Invalid driver designator lazarus / 16-Databases ---------------------------------------------------------------------- TapArcer72 · 2016-03-14 18:59 I''ve been trying to connect to Oracle from Windows client, several days and yet no result. In my TOracleConnection I set These values: DatabaseName: :1521/ Hostname: Password: UserName: When I try to connect, I receive this error: OracleConnection1: ORA-06401: NETCMN: Invalid driver designator Using Sqlplus, my connection works fine. Do I have to put my TNSNAMES.ORa somewhere I don't know? Is there any problems with installed dll's? Would someone please help me? Thank you a lot. ---------------------------------------------------------------------- avra · 2016-03-15 08:52 Quote from: TapArcer72 on March 14, 2016, 07:59:31 pmOracleConnection1: ORA-06401: NETCMN: Invalid driver designatorYou didn't think of searching the net for that mentioned error in bold, did you? http://www.dba- oracle.com/t_ora_06401_netcmn_invalid_driver_designator.htm SQL*Net parses the "tnsnames.ora" file for connection information. Seeing the first character of ^M after the alias somehow made SQL*Net think it had an invalid protocol selection for a version 1 connect string. This prompted the computer to return an invalid version 1 error, ORA-06401. Also for some reason, it only affected connection attempts using a database link. You also have an error in OracleConnection, try this: QuoteDatabaseName: (like MYDBALIAS) Hostname: : (like myserver.domain.name:1523) Password: UserName: Besides OracleConnection, put SQLTransaction, SQLQuery, DataSource and DBGrid and connect them to see quick results. http://wiki.freepascal.org/SQLdb_Tutorial0 http://wiki.freepascal.org/SqlDBHowto http://wiki.freepascal.org/Working_With_TSQLQuery http://www.freepascal.org/docs-html/fcl/sqldb/tsqlquery.html http://wiki.freepascal.org/Oracle ---------------------------------------------------------------------- TapArcer72 · 2016-03-15 18:27 Thank you for your answer. My history of the actual problem wasn't complete, actually I looked for ^M special char in my tnsnames.ora, but there's  nothing like that at all. ---------------------------------------------------------------------- avra · 2016-03-16 08:13 Quote from: TapArcer72 on March 15, 2016, 07:27:16 pmI looked for ^M special char in my tnsnames.ora, but there's  nothing like that at all.^M is Control+M which is #13 or carriage return (CR). Windows likes to write CR+LF on line ending, while linux likes to write just LF. If you have edited "tnsnames.ora" file in notepad then unwanted ^M might be added. Look at file in a binary way and search for 013 bytes and eliminate all of them. According to error message that might be your problem. I didn't have to change my"tnsnames.ora" at all to access several Oracle servers, so alternatively you might want to revert original file and try again. All I have done is installed Oracle client (with 3rd option checked, I think it was development tools) and populated Lazarus components as already described. You need to restart computer after client installation, and check if client installation dir with "oci.dll" is in path (it should be). http://www.columbia.edu/kermit/ascii.html http://its.ucsc.edu/unix-timeshare/tutorials/clean-ctrl-m.html Btw, have you changed the properties of OracleConnection as I have suggested? Any change? ---------------------------------------------------------------------- TapArcer72 · 2016-03-16 09:10 To edit tnsnames.ora I used Notepad++, which can show and deal with special chars like CR and LF. No CR at all in my tnsnames.ora. I made the corrections you suggested, without result. By now, I workaorunded  using ODBC connection. In case of news, I'll post them. Thank you a lot again. ---------------------------------------------------------------------- avra · 2016-03-16 13:00 Quote from: TapArcer72 on March 16, 2016, 10:10:06 amNo CR at all in my tnsnames.ora.Can you connect from Lazarus if you backup "tsnames.ora" and then temporary delete it just for testing?