Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: dsn less connection

Re: dsn less connection

From: Michael Hill <hillmw_at_ram.lmtas.lmco.com>
Date: Thu, 18 Mar 2004 12:39:41 -0600
Message-ID: <4059ECED.E5F53CB2@ram.lmtas.lmco.com>

Michael Hill wrote:
>
> >
> > I have this vba code that connects to an oracle like:
> >
> > oConn.Open "Driver={Oracle ODBC Driver};" & _
> > "ConnectString=MYSERVER;" & _
> > "Uid=myUsername;" & _
> > "Pwd=myPassword"
> >
> > When I passed it out to some users it errored out because "MYSERVER" was not
> > in their tnsnames.ora file.
> >
> > How do I specify a dsn string where all this information is contained in the
> > connection?
>
> I tried this:
>
> cmd.ActiveConnection =
> "
> Driver={Microsoft ODBC for Oracle};
> Host=myhost;
> Port=1526; // also tried 1521
> SID=mysid;
> UID=myuid;
> PWD=myuid
> "
>
> I am getting an error:
>
> "Driver's SQLSetConnectAttr failed"
>
> I specified the 2 key items from the tnsnames.ora file, Host and Port.
>
> I'd need to NOT have to make an entry in tnsnames.ora because many users
> won't be able to do this.
>
> Mike

If I change the Driver to "ORACLE ODBC DRIVER" then I get an error message about tns, like:

"TNS:protocol adapter error"

Do I "have" to have a tnsnames.ora file or can I specify some file on a server and not on each machine?

Mike Received on Thu Mar 18 2004 - 12:39:41 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US