Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-14-2013, 14:01
giv's Avatar
giv giv is offline
VIP
 
Join Date: Jan 2011
Location: Romania
Posts: 1,663
Rept. Given: 803
Rept. Rcvd 1,283 Times in 561 Posts
Thanks Given: 228
Thanks Rcvd at 567 Times in 241 Posts
giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299
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!
Reply With Quote
  #2  
Old 05-14-2013, 21:15
wilson bibe wilson bibe is offline
VIP
 
Join Date: Nov 2012
Posts: 506
Rept. Given: 493
Rept. Rcvd 439 Times in 180 Posts
Thanks Given: 1,166
Thanks Rcvd at 179 Times in 114 Posts
wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499 wilson bibe Reputation: 400-499
Try this:http://www.vbcode.com/default.htm, there are 8 pages with threads about oracle in the section Database
Reply With Quote
  #3  
Old 05-19-2013, 06:31
piccolo piccolo is offline
Friend
 
Join Date: Jul 2006
Posts: 28
Rept. Given: 4
Rept. Rcvd 3 Times in 1 Post
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
piccolo Reputation: 3
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..
Reply With Quote
  #4  
Old 05-20-2013, 13:58
fqjp fqjp is offline
Friend
 
Join Date: Apr 2011
Posts: 46
Rept. Given: 1
Rept. Rcvd 2 Times in 1 Post
Thanks Given: 2
Thanks Rcvd at 38 Times in 20 Posts
fqjp Reputation: 2
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
Reply With Quote
  #5  
Old 05-20-2013, 14:45
giv's Avatar
giv giv is offline
VIP
 
Join Date: Jan 2011
Location: Romania
Posts: 1,663
Rept. Given: 803
Rept. Rcvd 1,283 Times in 561 Posts
Thanks Given: 228
Thanks Rcvd at 567 Times in 241 Posts
giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299
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.
Attached Files
File Type: rar Ora.rar (422.4 KB, 5 views)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 00:31.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )