Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problem to connect between Oracle 10g xe and VB2010 at Vista sp2

785734Jul 18 2010 — edited Jul 19 2010
Introduction
Hi guys, good day... NEED RESCUE!! SOS!! Hmm.. i have trouble been 1 weeks trying connect between Oracle 10g xe and VB2010 on window vista sp2. Actaully im very new at Oracle 10g xe and VB2010 but i got a project is going to build up system database and i figure out Oracle 10g xe and VB2010 can use free so i just chows these appication to be my project. I been search around internet and there is several things i was found about the connection but i has try and tried still it wont work out.

Things i found and learned
Oracle
1. I have download Oracle 10g XE and installed in my windows vista sp2.
2. I notice the Oracle Developer Tools is needed for VB2010 (To add reference 'Oracle.DataAccess'). So i was downloaded ODT11beta and installed
3. I also edit TNSNAMES to following below:
OraDb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = shin-PC)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

4. My sqlnet like following below:
SQLNET.AUTHENTICATION_SERVICES = (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

5.I have try tnsping OraDB and its works.
6. I monitoring task manager and OracleServicesXE is running.
7. ora_dba is added in Group.

Problem in SQLPLUS
When i try connect SQLPLUS in cmd i get ERROR: ORA-12560: TNS:protocol adapter error.
i . In cmd i type sqlplus and enter then i been ask for username and password.
ii. After i insert my username and password and enter then i get the error of ORA-12560.

Visual Basic 2010
1. First i created my project, drawing label and button for test connection.
2. Then, i add reference Oracle.DataAccess into my project.
3. I type following script into my vb form:

Imports System.Data
Imports Oracle.DataAccess.Client
Imports Oracle.DataAccess.Types

Public Class Logon

Private Sub cmdLogon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogon.Click
Dim oradb As String = "Data Source = OraDb; User Id = system; Password = shin;"
Dim conn As New OracleConnection(oradb)
conn.Open()
Dim cmd As New OracleCommand
cmd.Connection = conn
cmd.CommandText = "select SName from Staff where SName = shin"
cmd.CommandType = CommandType.Text

Dim dr As OracleDataReader = cmd.ExecuteReader()
dr.Read()
lblOra.Text = dr.Item("SName")
conn.Dispose()

End Sub
End Class

Problem in VB2010
When i run my project and press the button i get error message ORA-12514: TNS:could not resolve the connect identifier specified at conn.Open()

Extra Question*
1. Im notice in my netbook xp home sp2, before i install ODT11beta my sqlplus look fine thought cmd but after i installed ODT11beta its same problem with my Vista sp2 now. Get error ORA-12560: TNS:protocol adapter error :( I tried uninstall ODT11beta again and restart its work fine again. Which i really dun understand. Izzit the version ODT11 is not suitable for 10g xe? And i dunno this problem is related with my connection between oracle 10g xe and vb2010 or not. So confuse@@

2. I wish to know more about connect between Oracle and VB, is there still a things i miss?(I mean steps or configuration that should i done)

3. Or i just lower my VB version could make more easy? If yes, what version VB should i use that could work out with oracle 10g xe?

4. Sorry for too bad my english but i really wish somebody could help me. Please try to understand my written or you could ask me mean if dont understand. Im stuck!! Stuck feel not really that good.....

Edited by: user9173084 on Jul 19, 2010 3:34 AM

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 16 2010
Added on Jul 18 2010
7 comments
1,598 views