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: Oracle Data Control Objet in VB

Re: Oracle Data Control Objet in VB

From: Matthias Gresz <GreMa_at_t-online.de>
Date: 25 Nov 1998 12:57:54 GMT
Message-ID: <73gusi$fga$3@news02.btx.dtag.de>


Hi,

Oracle schrieb:
>
> Is the ODBC DNS entry for the database you are connect to is ExmapleDb or
> others? You must first setup this up first to access the oracle database.
> The configuration utility is in the control panel called 'ODBC Config'.

I'm sorry to say that you're wrong. oo4o doesn't use ODBC. Xiaodipi (Where is your real name?) just has to replace 'ExampleDB' with the alias he has given his db using SQL*NetEasy. The example woll work when he ran the example creating script thus setting up user scott and the tables associated with this user.

>
> >I used Personal Oracle 8. I try to run the examples
> >in directory \OraWin95\oo4o21\vb\samples\ . They are about how to use
> Oracle
> >Data Control Object in Visual Basic. But when I run these examples, I
> always
> >get an error message box which displays "Unable to make connection,
> ORA-12154:
> >TNS:could not resolve service name".
> >
> > I encoutered the same problem when I copy the following code from Oracle
> >Objects for OLE 2.1 help file. I failed to run it, again an Error Message
> box
> >displayed "Unable to make connection, ORA-12154:TNS: could not resolve
> service
> >name" when the statement "Set OraDatabase = OraSession.DbOpenDatabase
> >("ExampleDb", "scott/tiger", 0&) was executed.
> >
> >
> >Sub Form_Load ()
> >
> > 'Declare variables as OLE Objects.
> > Dim OraSession As Object
> > Dim OraDatabase As Object
> > Dim OraDynaset As Object
> >
> > 'Create the OraSession Object.
> > Set OraSession = CreateObject("OracleInProcServer.XOraSession")
> >
> > 'Create the OraDatabase Object by opening a connection to Oracle.
> > Set OraDatabase = OraSession.DbOpenDatabase("ExampleDb", "scott/tiger",
> 0&)
> >
> > 'Display the username and database to which you have connected.
> > MsgBox "Connected to " & OraDatabase.Connect & "@" &
> OraDatabase.DatabaseName
> >
> >End Sub
> >
> >
> >Would any one do me a favor? Thank you so much.
> >
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

--
Matthias.Gresz_at_Privat.Post.DE

Always log on the bright side of life.
http://www.stone-dead.asn.au/movies/life-of-brian/brian-31.htm Received on Wed Nov 25 1998 - 06:57:54 CST

Original text of this message

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