Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   Connect from VB6 or .NET to Oracle SQL 8 (https://forum.exetools.com/showthread.php?t=14998)

giv 05-14-2013 14:01

Connect from VB6 or .NET to Oracle SQL 8
 
Hi all!
I want to ask you if anyone worked on a similar project.
I want to code a simple querry aplication in VB6 or .NET that connect to a Oracle SQL server from a client station.

This is what SQL consola display:
Quote:

Connected to:
Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
With the Partitioning option
JServer Release 8.1.7.0.0 - Production
I seen many solutions but unfortunate the lowest version of Oracle SQL that is suported by respective code is 9.XX

I wonder if anyone can help me to solve this issue.
Thank you!

wilson bibe 05-14-2013 21:15

Try this:http://www.vbcode.com/default.htm, there are 8 pages with threads about oracle in the section Database

piccolo 05-19-2013 06:31

Either install the oracle instant client or install the full oracle client with odbc support.
Suppose you install the full client which I usually do to c:\oracle
then you can find a filename tnsadmin.ora, this one contains the settings to your databases (for remote and local databases). Check out www.orafaq.com/wiki/Tnsnames.ora for details. here you need to add your database names. Be aware that remote databases must of course have the correct ip and correct port number and sid (your dbadmin should know those). For a local db you can use the example given (check the port numebr tho).
Have oracle in your path and reboot (if needed). Start your c:\oracle\bin\sqlplusw.exe and enter your username, password and sid. If this does not work then you have a setting wrong or your firewall is stopping you. Basically it should work.
After that you should be able to get your oracle working via odbc or via .net drivers fairly easy. You can use ms access or a free tool like foxysql or freesql to check that.
You can use the microsoft odbc driver for oracle but also the oracle odbc driver from oracle itself (which is what I prefer).
The difference between the two is that a timestamp datatype doesnt work properly in the microsoft version and that a clob and blob seem to work somewhat different in the microsoft compared to the oracle driver.
I myself always prefer the microsoft odbc driver.
This should get you started quickly.

The instantclient can be set up easily as well but you'd miss some of the tools that are handy. But setting up both will cause trouble so be warned..

fqjp 05-20-2013 13:58

The following codes using odbc��u can try it.

connect server
Public Function ConnectServer(ByVal ServerName As String, ByVal DBName As String, ByVal UserName As String, ByVal PWD As String) As Boolean

Dim ConnectString As String

On Error GoTo Error_ConnectServer

rdoEngine(0).CursorDriver = rdUseClientBatch
ConnectString = "Driver={Microsoft ODBC For Oracle};Server=" & DBName & "_" & ServerName & ";UID=" & UserName & ";PWD=" & PWD & ";"
Set grdoCN = rdoEngine(0).OpenConnection("", rdDriverNoPrompt, False, ConnectString) ', rdAsyncEnable)

ConnectServer = True
Exit Function

Error_ConnectServer:
ConnectServer = False
End Function

connect oracleserver
Public Function ConnectOracleServer(ByVal ServerName As String, ByVal DBName As String, ByVal UserName As String, ByVal PWD As String) As Boolean
Dim strConnect As String

On Error GoTo Error_ConnectOracleServer

strConnect = "Driver={Microsoft ODBC For Oracle};Server=" & DBName & "_" & ServerName & ";UID=" & UserName & ";PWD=" & PWD & ";"
adoORACLEConnect.Open strConnect

ConnectOracleServer = True
Exit Function

Error_ConnectOracleServer:
ConnectOracleServer = False
End Function

giv 05-20-2013 14:45

1 Attachment(s)
Before starting anything i make a clarify.
I use Oracle8i Enterprise Edition Release 8.1.7.0.0
The network is based on a server.
All the clients connect and work on server on the LAN.
I have a client station with the client software already installed and i work on client interface.
Before thinking to connect via ODBC drivers i take a look here:
Quote:

http://www.oracle.com/technetwork/database/windows/downloads/index-096177.html
The lower version supported by ODBC is 9.0.1.8.0 and i use 8.1.7.0.0 so i guess this kind of connection is not possible.
I am wrong?
For connecting to database with third party tools i use Lotus Approach and select "Microsoft ODBC for Oracle" driver.
I can connect to database of course because i work dayly on this platform from a client staion.
My question is how to setup the Visual Basic 6 or Visual Basic .NET to connect to the database because i want to develop a simple app that does small querryes on the database.
From what i read on www all methots involve Oracle SQL 9.xx or greater and from what tuts or faqs i followed none aplly to my case.
That is why i try to contect persons who can lead me or tell me what i do wrong.


All times are GMT +8. The time now is 16:59.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX