Hi Paul,

i have changed to 1&. However, i still received the same error.


Thanks

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

> The only difference in what you have and what I use is that last parameter
> of the OpenDatabase command I use is:
> , 1&)
>
> rather than your:
> , 0&)
>
> other than that,
> your TNSNAMES file has to have an entry equivalent to:
>
> DATABASE_NAME =
>   (DESCRIPTION =
>     (ADDRESS_LIST =
>     (ADDRESS = (PROTOCOL = TCP)(HOST = yourhostnamehere)(PORT =
> yourportidhere))
>     )
>     (CONNECT_DATA = (SID = DATABASE_NAME)(SERVER = DEDICATED))
>     )
>
> (need to replace DATABASE_NAME, your host name, and port #)
>
>
> Another thing....
>
> You said that "I was successful when i had 10g in my system, currently im
> on 11g..."
> Anything else change?
>
> Did you change Windows version (to Windows 7)
> Are you on a 64 bit machine?
>
>
> *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
>



-- 
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

Reply via email to