DSN less Connection to Oracle 8i via ODBC
430951Oct 11 2004 — edited Oct 13 2004Hello,
i have been working on a solution for my problem since 2 month.
i would be very grateful if anybody could help me to solve it.
facts:
OS: win 2k
software development in Visual Basic 6
ADO DRIVER 2.5
installed ODBC Driver:
Microsoft ODBC for Oracle 2.573.6200.00
Oracle ODBC Driver 8.01.07.00
MySQL ODBC Driver 3.51
Databases in networkenv.:
MYSQL 4
Oracle 8i 8.1.7.3.0
Story:
i wrote a DBconnect module in VB 6 that is able to connect DSN less to above mentioned MYSQL Server, the connection string is:
Conn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=myServerName;" & _
"DATABASE=myDatabaseName;" & _
"USER=myUsername;" & _
"PASSWORD=myPassword;"
That works fine !
Problem:
Now i have to connect to above mentioned ORACLE DB. For flexibility reasons, i have to connect DSN less as well.
I 've found at least 10 different versions of connectionstrings for using Microsoft ODBC for Oracle 2.573.6200.00
AND Oracle ODBC Driver 8.01.07.00. None of them are working.
for ex. i tried the following to connect with current Oracle ODBC Driver from Microsoft)
Conn.Open "Driver={Microsoft ODBC for Oracle};" & _
"Server=OracleServer.world;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"
Conn.Open "Driver={Microsoft ODBC for Oracle};" & _
"Host=OracleServer.world;" & _
"Port=1521" & _
"SID=dbss" & _
"Uid=myUsername;" & _
"Pwd=myPassword"
The second seems to be more logical because it contains the relevant SID-information (since version Oracle 8i).
i get "Error in SQLSetConnect-Attr" as error using MSORA and "TNS: Error in Protocoladapter" (german translation ;)) using the Oracle ODBC Driver.
Then i found this example for the Oracle Driver:
Conn.Open "Driver={Oracle ODBC Driver};" & _
"Dbq=myDBName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword"
Where: The DBQ Name must be defined in the tnsnames.ora file
It does not work at all.
Is it possible to connect DSN LESS via ODBC (MS or Oracle) without editing any DNS or TNS.ora settings?
Does anybody know the right connection string for this scenery?
I can't change to UNIX or VB.NET, so please dont suggest me to do that ;).
The DB connection to Oracle is working with installed Oracle Client Software (208 MB), so the physical connection is working!
i hope you can show me the right way.
tnx ale