Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: OCI - Connecting to Database
Harish,
A correct connecion string is : <User>/<Pass>@<TnsName>
Example: 'MyUser/Password_at_Prod'
Where MyUser is a real user name, Password is his/her password and TnsName is a name from
TnsNames.ora file.
in OCI 7.x use function olog(...) where uid - is <User> , pswd - is <Pass>
, conn - is <TnsName>
in OCI 8.x use function OCILogon(...) where username - is <User> ,
password - is <Pass>,
dbname - is <TNSName>
Note: if you specify wrong <TnsName> in connection string Oracle client may try to connect to "Default"
connection .
HTH
Thomas Olszewicki
ThomasO_at_cpas.com
www.cpas.com
"Harish" <hdeshpandeNOhdSPAM_at_carlson.com.invalid> wrote in message
news:17599f0b.0f3d7f99_at_usw-ex0107-042.remarq.com...
> Hi,
>
> I have developed a client/server application using OCI on NT 4.0.
> When I converted this application to an NT service I found that it is
> connecting to a different database. I do not know how it is connecting
> to a different database as the connect string is the same. One way to
> overcome this problem is to supply the connect description in the
> connect call it is possible. Can one any of you please provide me with
> a sample for this. Oracle documentation does not have a sample for
> this.
>
> My current connect string is as follows: uname/passwd_at_dbname
>
> I want to know if this can be changed to: uname/passwd@(x) where x
> is similar to an entry in 'tnsname.ora'.
>
> Thanks in advance for your time and help.
>
> Harish
>
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!
>
Received on Thu Jan 06 2000 - 15:46:54 CST