Re: Oracle 8ior9i connection

"Sammy Msafiri" <[email protected]> Tue, 28 Jan 2003 15:29:49 -0800
Newsgroups gmane.comp.db.oracle.devel
Message-ID <LYRIS-1796914-853055-2003.01.29-13.36.42--gcdod-oracle#[email protected]>

You need to setup the TNS names properly.  Have you configured sql plus to
connect to the database.
Configure Database SID from the Net Configuration assistant.
Test it with the  Oracle ODBC test.

Then from windows ODBC in control panel
Create a new Data Source based on the Oracle SID

Data Source Name    =     MyOrcleConnection
Description                =     MyOrcleConnection
Service Name            =     ORCL.WORLD
USER ID                   =     Any existing user having access to the
required database objects.

In VB Create a connection string like this.

Set cn = New ADODB.Connection
cn.Provider="MSDASQL.1;password=demo;Persist Security Info=False;User
ID=demo;DSN=orcl.world;UID=demo;DBQ=orcl.world;"

cn.Open

'Then connect to a table using a recordset

set rs =  new ADODB.recordset
rs.open"Select * from MyTable",cn, adOpenDynamic, adLockOptimistic

if rs.EOF THEN
        MSGBOX"NO RECORDS IN THE TABLE"
ELSE
       RS.MOVEFIRST
       'code to displya to a form
end

rs.close





____________________________________________________________________
- This email and any files transmitted with it are confidential and
  intended solely for the use of the addressee. If you have received
  this email in error you may not disclose, copy, distribute or act
  upon its contents without the authors prior written consent. Please 
  can you notify the system manager at [email protected]
  immediately and delete this email.
- Any views or opinions expressed are those of the author and do not
  necessarily represent those of Somak Travel Limited, Kenya.
- This footnote also confirms that this email message has been swept
  for the presence of computer viruses. No responsibility can be
  accepted in the event that a virus is contained within it or any
  attachments.
- SOMAK TRAVEL LTD - KENYA
  NAIROBI, PO BOX 48495. Tel: +(2542) 557832 Fax:+(2542) 535175
  MOMBASA, PO BOX 90738. Tel: +(25411)5486197 Fax:+(25411)5487324
____________________________________________________________________

---
Change your mail options at http://p2p.wrox.com/manager.asp or 
to unsubscribe send a blank email to [email protected].