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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Newbie ODBC Q: How to connect to MY database

Re: Newbie ODBC Q: How to connect to MY database

From: GHouck <hksys_at_teleport.com>
Date: 2000/05/24
Message-ID: <392C2603.7BC3@teleport.com>#1/1

Jeff wrote:
>
> Hi,
>
> I've created my own database under POLITE
> ie I log in via sqlplus as ODBC:POLITE:MYDATABASE
>
> and the ODBC examples work on the sample database with:
>
> #define DSN "POLITE"
> char *DataSource = DSN;
> char *UserId = "", *Password = "";
>
> rc=SQLAllocEnv(&Henv
> rc=SQLAllocConnect(Henv, &Hdbc
> rc = SQLConnect(Hdbc, (unsigned char *)DataSource, SQL_NTS,
> (unsigned char *)UserId, SQL_NTS,
> (unsigned char *)Password, SQL_NTS);
>
> but how do I connect to my own database thru ODBC ?
>
> #define DSN "POLITE:MYDATABASE" doesn't work.
>
> Thanks:

In the Oracle ODBC Administrator, you create a Data Source, giving it a Name (DSN). In that process you specify the Username, [Password], and [Server] with which ODBC associates the Data Source Name.

Then you specify that name as the value in the:

 #define DSN "yourDsnName"

Yours,

Geoff Houck
systems hk
hksys_at_teleport.com
http://www.teleport.com/~hksys Received on Wed May 24 2000 - 00:00:00 CDT

Original text of this message

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