Re: using a VB6 program to access an oracle 7 database

From: <cpereyra_at_ix.netcom.com>
Date: Fri, 01 Oct 1999 22:40:31 GMT
Message-ID: <7t3d8t$m7p$1_at_nnrp1.deja.com>


Mike:

In the UNIX server you will need nothing other than the standard database and listener that should already be there and available. In each of the clients running your VB application you will need Oracle client software configured to talk to the database on the UNIX server and a ODBC driver suitable to connect to Oracle (either Oracle's ODBC driver or Microsoft ODBC driver)
The driver has to be configured to provide a DSN (Data Source Name) that points to the Oracle client software via the tnsnames.ora file. The DSN will have a suitable name that you will provide, for example, MYDSN.
In your VB application you will connect to the Oracle database using one of various approaches ( I find DAO the easiest but ADO is fine as well ) In DAO, the code will look something like this:

dim db as database
dim rs as recordset
dim strConnect, strSQL as string

strConnect = "ODBC;DSN=MYDSN;PWD=mypassword;UID=myuserid"

set db = opendatabase("", dbdrivernoprompt, false, strConnect)

strSQL = "select * from table"

set rs = db.openrecordset(strSQL, dbopensnapshot, dbsqlpassthrough)

if not (rs.bof and rs.eof) then

   whatever you want to do.....

Don't be confused by the dbopensnapshot and dbdrivernoprompt and so forth, they are parameters that control how the connection and recordset behaves. You may need different parameters than those in the code.

Hope this helps.

Carlos.

In article <eCXI3.900$ti4.26741_at_news1.mts.net>,   "Keith Lowdon" <klowdon_at_mts.net> wrote:
> You might try ADO if you are using VB. It seems to connect nicely
and it
> can be quite simple to use. I've only used it with NT. Peter
Jennings has
> an excellent book that outlines what you will need to do.
>
> Ed Prochak <prochak_at_my-deja.com> wrote in message
> news:7std0n$8en$1_at_nnrp1.deja.com...
> > In article <37f15beb.930921_at_news.teleport.com>,
> > jahmike_at_eleport.com (Mike) wrote:
> > > I have recently been asigned to convert a VB application written
with
> > > the professional edition to be able to work with a new application
> > > which is replacing an application that it currently interfaces
with.
> > > The new application runs on an Oracle database running on a UNIX
> > > platform. I need some information on what needs to be done in
order
> > > to get the application to be able to retrieve data from the oracle
> > > database. Any informtion would be appreciated.
> > >
> > > Mike
> > >
> >
> > Look into ODBC (Open DataBase Connection).
> >
> > --
> > Ed Prochak
> > Magic Interface, Ltd.
> > ORACLE services
> > 440-498-3700 <<<NOTE new number
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sat Oct 02 1999 - 00:40:31 CEST

Original text of this message