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:14:25 -0600
Message-ID: <4059E701.C6774BB@ram.lmtas.lmco.com>


>
> 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 Received on Thu Mar 18 2004 - 12:14:25 CST

Original text of this message

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