What about your TNSNAMES file?
 
Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------




________________________________
From: t vinay <vinaytu...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Wed, May 23, 2012 3:29:10 PM
Subject: Re: $$Excel-Macros$$ Oralce Connection

Hi Paul, 

please find the below vba code.

Dim Database_Name As String
    Dim User_ID As String
    Dim Password As String
    Dim SQLStr As String
    
    Dim OraDynaSet As Object
    Dim objSession As Object
    Dim objDataBase As Object
    Dim i As Integer
   
    'Create a reference to my database
    Database_Name = "DATABASE NAME" ' Enter your  database name here
    User_ID = "USER_NAME" ' enter your user ID here
    Password = "PASSWORD" ' Enter your password here


    Set objSession = CreateObject("OracleInProcServer.XOraSession")
    Set objDataBase = objSession.OpenDatabase(Database_Name, User_ID & "/" & 
Password, 0&)
    
    

    SQLStr = Sheets("Query").Cells(1, 1).Value
    
    
    objDataBase.ExecuteSQL (SQLStr)
    
    'Retrieve the results from Oracle
    Set OraDynaSet = objDataBase.DBCreateDynaset(SQLStr, 0&)
        
    
    If OraDynaSet.RecordCount > 0 Then
        'There were records retrieved
        OraDynaSet.MoveFirst

Thanks,
Vinay. T



On 24 May 2012 00:39, Paul Schreiner <schreiner_p...@att.net> wrote:

Can you show what your tnsnames.ora entry looks like?
>
>And what your VBA connect string looks like?
>
> 
>Paul
>-----------------------------------------
>“Do all the good you can,
>By all the means you can,
>In all the ways you can,
>In all the places you can,
>At all the times you can,
>To all the people you can,
>As long as ever you can.” - John Wesley
>-----------------------------------------
>
>
>
>
>
________________________________
From: t vinay <vinaytu...@gmail.com>
>To: excel-macros@googlegroups.com
>Sent: Wed, May 23, 2012 2:51:47 PM
>Subject: $$Excel-Macros$$ Oralce Connection
>
>
>Hi Team, 
>
>
>please help me with the vba code to connect to oralce database 11g. I was 
>successful when i had 10g in my system, currently im on 11g and its throwing 
>an 
>error message.
>
>
>attached is the screenshot of the error message
>
>
>-- 
>
>Regards,
>
>Vinay. T
>-- 
>FORUM RULES (986+ members already BANNED for violation)
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
> 
>2) Don't post a question in the thread of another member.
> 
>3) Don't post questions regarding breaking or bypassing any security measure.
> 
>4) Acknowledge the responses you receive, good or bad.
> 
>5) Cross-promotion of, or links to, forums competitive to this forum in 
>signatures are prohibited. 
>
> 
>NOTE : Don't ever post personal or confidential data in a workbook. Forum 
>owners 
>and members are not responsible for any loss.
> 
>------------------------------------------------------------------------------------------------------
>
>To post to this group, send email to excel-macros@googlegroups.com
> 
>To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com
>-- 
>FORUM RULES (986+ members already BANNED for violation)
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
> 
>2) Don't post a question in the thread of another member.
> 
>3) Don't post questions regarding breaking or bypassing any security measure.
> 
>4) Acknowledge the responses you receive, good or bad.
> 
>5) Cross-promotion of, or links to, forums competitive to this forum in 
>signatures are prohibited. 
>
> 
>NOTE : Don't ever post personal or confidential data in a workbook. Forum 
>owners 
>and members are not responsible for any loss.
> 
>------------------------------------------------------------------------------------------------------
>
>To post to this group, send email to excel-macros@googlegroups.com
> 
>To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com


-- 

Regards,

Vinay. T
-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

 
NOTE : Don't ever post personal or confidential data in a workbook. Forum 
owners 
and members are not responsible for any loss.
 
------------------------------------------------------------------------------------------------------

To post to this group, send email to excel-macros@googlegroups.com
 
To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com

Reply via email to