By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,826 Members | 815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,826 IT Pros & Developers. It's quick & easy.

ORA-12560: TNS: protocol Adapter Error

P: 2
Dear All,

I am Karhtikeyan, Exploring the Database conectivity from VB to Oracle9i, I typed the following coding in VB but it gives protocol arapter error.

Dim con As New ADODB.Connection
Dim r As New ADODB.Recordset
Private Sub Form_Load()
con.ConnectionString = "Provider=msdaora.1;password=tiger;user id=scott"
con.CursorLocation = adUseClient
r.Open "kark", con, adOpenDynamic, adLockOptimistic, adCmdTable
End Sub

I got Oracle server in one machine and client in another I am working from client machine.

I can able to connect to SQL using Scott, tiger and host string and open all the databases in server but I am not able to connect from VB.

What are the steps to connect from Vb to oracle

earlier I used to connect from VB5 with Oracle8 both in same machine the above coding worked well there but here it is VB6 and Oracle 9i

thanks for your timing
Aug 23 '06 #1
Share this Question
Share on Google+
2 Replies

P: 14
I think in connection string u r not specified the database name.Try it....
Aug 24 '06 #2

P: 2
Thanks It worked another way,

Set objADO = CreateObject("ADODB.Connection")
objADO.Open "Driver={Microsoft ODBC for Oracle}; CONNECTSTRING=MODOSE; UID=scott; PWD=tiger;"
r.Open "kark", objADO, adOpenDynamic, adLockOptimistic, adCmdTable
MsgBox "Connection Established to Server.", vbExclamation + vbOKOnly, "System"

Kark is the Database Name in Oracle9i-Server

I wrotte this coding in Form Load event, It takes lot of time to establish the connection, then only the Form loads, I wish to Provide a message "Connecting to Database Please wait..." in form Initialize event, but the only provision is Using Msgbox I think, Is there any other way to Hold the User untill the Connction establishes.

If we use the Msgbox the program waits untill the user clicks the Ok button, then starts establishing the connection giving the same log time hanging.

regards - kark
Aug 25 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.