Recent

Author Topic: ORA-06401: NETCMN: Invalid driver designator  (Read 6511 times)

TapArcer72

  • Newbie
  • Posts: 3
ORA-06401: NETCMN: Invalid driver designator
« on: March 14, 2016, 07:59:31 pm »
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: <hostname>:1521/<SERVICENAME>
Hostname: <hostname>
Password: <scheme's password>
UserName: <scheme's name>

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

  • Hero Member
  • *****
  • Posts: 1711
    • Additional info
Re: ORA-06401: NETCMN: Invalid driver designator
« Reply #1 on: March 15, 2016, 09:52:01 am »
OracleConnection1: ORA-06401: NETCMN: Invalid driver designator
You 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:
Quote
DatabaseName: <dbname> (like MYDBALIAS)
Hostname: <hostname>:<portnumber> (like myserver.domain.name:1523)
Password: <scheme's password>
UserName: <scheme's name>

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
« Last Edit: March 15, 2016, 10:00:22 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

TapArcer72

  • Newbie
  • Posts: 3
Re: ORA-06401: NETCMN: Invalid driver designator
« Reply #2 on: March 15, 2016, 07:27:16 pm »
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

  • Hero Member
  • *****
  • Posts: 1711
    • Additional info
Re: ORA-06401: NETCMN: Invalid driver designator
« Reply #3 on: March 16, 2016, 09:13:28 am »
I 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?
« Last Edit: March 16, 2016, 09:22:17 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

TapArcer72

  • Newbie
  • Posts: 3
Re: ORA-06401: NETCMN: Invalid driver designator
« Reply #4 on: March 16, 2016, 10:10:06 am »
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

  • Hero Member
  • *****
  • Posts: 1711
    • Additional info
Re: ORA-06401: NETCMN: Invalid driver designator
« Reply #5 on: March 16, 2016, 02:00:55 pm »
No 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?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib