Error : 'The Connection can not be used to perform thsi operation

Dear All,
I am getting an error like 'The Connection can not be used to perform thsi operation, it is either close or Invalid in this context.
Below is the code what am using:
Sub Select_Query()
Dim SQL_String As String
Dim rs As ADODB.Recordset 'This holds the data
Dim cn As ADODB.Connection 'Declaring Connection
Dim cmdobj As ADODB.Command 'Declare command Object
'Sheets("Payment").Select
Set cn = New ADODB.Connection
cn.Open ("Provider=MSDAORA;Data Source=MyDatabase;User ID=Prasad; Password=Prasad12;")
Dim count_value As Long
count_value = WorksheetFunction.CountA(Worksheets("Payments").Range("A:A"))
For i = 4 To count_value
SQL_String = Worksheets("Payments").Range("AA" & i).Value
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open SQL_String, cn, adOpenForwardOnly, adLockOptimistic, adCmdText
Dim val As Integer
val = rs.recordCount
If val = 0 Then
Worksheets("Payments").Range("AZ" & i).Value = "No"
'Else
'Worksheets("Uploaded").Range("O" & i).Value = "Yes"
End If
cn.Close
Set con = Nothing
Next
'cn.Execute SQL_String
'con.Close
Set con = Nothing
End Sub
And select statment is picking one of the sheets, and SQL query is:
="SELECT sa.acct_id
FROM ci_sa sa, ci_sp sp, ci_sa_sp ss, ci_sp_geo spg,ci_acct_char cac
WHERE sa.sa_id = ss.sa_id
AND ss.sp_id = sp.sp_id
AND sp.sp_id = spg.sp_id
AND spg.geo_type_cd LIKE '%RR%'
AND spg.geo_val ='"&B4&"'
and sa.ACCT_ID=cac.ACCT_ID
AND cac.char_type_cd LIKE '%SDO%'
AND TRIM (char_val) IN ('"&Master!G9&"')"
Please help me in this..
Regards,
Prasad

Please, this is a Oracle forum, not a VBA forum. Mark this thread as answered and post it in a VBA forum.

Similar Messages

  • HT1711 When I try to play a song on I-Tunes I receive the Message "The Song can not be used because original can not be found" Can anyone out there help me with this?

    When I try to play a song on I-Tunes, I receive the Message "The song can not be used because the original can not be found.  Can anyone out there help me  with this problem?

    The iTunes application saves your iTunes Store purchases--as well as any music, audiobooks, or videos you import--to your computer's hard disk, not the iTunes application itself.
    The error message you note indicates that the purchase in question can’t be located where it is stored in your iTunes Music folder in order to play it, and may have been moved or deleted.
    You will need to help iTunes locate the file. Follow the steps in this article:
    http://support.apple.com/kb/TS1967
    This article may also be helpful:
    http://support.apple.com/kb/TS1408

  • I am getting a message - the iphone can not be used because the apple mobile devise service is not started - what does this mean - what do i need to do?

    i am getting a message - the iphone can not be used because the apple mobile devise service is not started - what does this mean - what do i need to do?

    See Here...   http://support.apple.com/kb/TS1567

  • I keep getting an error The ipad can not be synced because the sync session failed. same error for my iphone. any ideas?

    I keep getting an error The ipad can not be synced because the sync session failed. same error for my iphone. any ideas?

    Try deleting iTunes from your computer. Do not delete your iTunes library. Then download and install a fresh copy if iTunes. Reboot your computer after installation of iTunes.
    Then reboot your phone. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider until the Apple logo appears. Let go of the buttons and let the device restart.
    Reconnect the phone to your computer running iTunes and see if the sync process will go through.

  • New ipod touch, Error: "The device can not be read or written to."

    I don't know what else to do!
    I also have an Ipod touch that just doesn't sync. When I connect the Ipod and launch Itunes to sync, it tells me that the device can not be written to:
    It just doesn't snyc at all. It's brand-new, out of the box and just doesn't work. And it's not my first ipod, so I know how to handle Itunes.
    That's what i've tried so far without success to solve the problem:
    * restored the touch hundreds of times, both in recovery and DFU mode and within the touch software
    * upgraded to firmware 1.1.4, downgraded back to 1.1.3, then to 1.1.2. and back to 1.1.4 - no change!
    * installed several different ITunes Versions and different Apple Mobile Device Services
    * tried MediaMonkey BETA with Ipod Touch support (this just creates 0kb files on the touch, but it also uses the mobile device service, so i guess the failure is somewhere there)
    * tried 4 different Windows XP systems with Itunes at my home and at friends (same error there as well)
    * restored my Windows XP with a recovery version and reinstalled Itunes completely from scratch
    * created a new user account in Windows XP and tried it with this one
    * launched Itunes with Internet switched off
    * used different USB ports - both 1.1 and 2.0
    * disconnected all USB devices
    * registered the necessary DLLs manually
    * last week, I sent the ipod to Apple (they claim that everything is fine and the problem is just me and my computer and sent it back without change)
    I don't have an apple in reach, so i'm not able to test it with an apple computer. There is also no apple store here in the country side of Germany.
    What else can be done? I know there are hundreds, that have the same problem but I don't know any more things to try. Now i have a 300 bucks touch i can not use as mp3 player...
    Message was edited by: basti007

    As I said, i did that! Quote:
    +* last week, I sent the ipod to Apple (they claim that everything is fine and the problem is just me and my computer and sent it back without change)+
    Today I got it back and nothing changed. I tried to call Apple Germany, but after i waited over 1,5 hours on the waiting line, i gave up.

  • V32 iOS 8 Error: The library can not be updated

    Hi,
    our customers have this error message after open an app v32:
    Knihovnu nelze aktualizovat
    Došlo k chybě
    in english: The library can not be updated
    An error has occurred
    This error is only when iPad is setup to czech language.
    When we setup to english language, app is open normally...
    And then is app open normally in czech language too.
    Any help pls?
    Thank you
    Tomas
    P.S. v32 was made and send to App Store 22. 9. 2014

    I did a search on Google for Error -39, and it suggests 2 things. Installing the latest version (which is sounds like you have) and turning OFF web accelerators if there are any running...
    http://docs.info.apple.com/article.html?artnum=44000

  • Got a new computer now I'm getting a new error "The song could not be used because the original file could not be found.  Would you like to locate it?"

    So i got a new computer and before i did i backed up al my music onto an external hard drive. I downloaded itunes and went to put my music back on and when I unplug my hard drive i get this message "The song could not be used because the original file could not be found.  Would you like to locate it?". I have close to 3500 songs so its a little annoying that i cant update or sync my ipod/iphone. Are there any tips or tricks you could help me with in order to fix this problem

    Here is the folder hierarchy of my /Home/Music/folder:
    Music folder
    iTunes folder
    iTunes Media folder
    Music folder
    Note that the contents of this last folder in the hierarchy will be different on your computer.

  • TS3694 Error: The Song "   "  could not be used because the original file could not be found. Would you like to locate it?  Cannot find song.

    When I try to pay a song from my itunes page a message pops up that says, The Song "     " could not be used because the original file could not be found. Would you like to locate it?  When I click of locate it cannot be found. This problem just started after I plugged in my new iPod Touch. After unplugging the ipod none of the songs in my iTunes library will plat.     HELP PLEASE.

    i've gotten that message after i delete a file so i think that is what is happening to you

  • When I started up Firefox after a 30 seconds de connection with my wifi disconnected. The connection can not starting also not when I had starting find problems in windows. I'm using windows 7 and firefox 7.0.

    When I than starting IE the connection will starting en is oké.

    You should actually be using Flash 10.3 (11.2 is insecure).[[Flash 11.3 doesn't load video in Firefox#w_solution-2-downgrade-flash|Solution 2: Downgrade Flash]].
    Also, is there a reason you are using Firefox ESR? It's mean for organizations, and doesn't include all the security and stability fixes that Firefox latest (15.0.1) has.

  • The attachment can not find using method CL_CRM_DOCUMENTS~GET_INFO

    Hi Dear Experts,
    I'm new guy in CRM, I used to develop in ECC. Here I encount an issue. We have attachment in the order. On web UI we can see the attachment is attached on the order. But when I use method CL_CRM_DOCUMENTS~GET_INFO to get the information of the attachment, I get nothing.
    I get GUID via table CRMD_ORDERADM_H with OBJECT_ID = order ID, get GUID and OBJECT TYPE, past it into method GET_INFO's interface BUSINESS_OBJECT, But I can not get anything.  I go to SU53, there are no authorization meesage about this method. Actually it informs me that I lost authorization object S_TABU_NAM, but it is related with SE16. So I don't think this cause the failure of get_info.
    Can anyone kindly give me any hints? Thank you so much.
    Regards
    Jay

    Hi Experts,
    I find that these attachments are Archived. So I think I can't get their information. So the next step is how to get the link information. Thanks.
    Regards
    Jay

  • When I plug my Ipod in, I'm getting the error "This Ipod can not be used because the Apple Mobile Device service is not started

    I keep getting this error and itunes isn't finding my ipod.  I cant put any songs on it or even view anything on it

    Try here:
    iPhone, iPad, iPod touch: How to restart the Apple Mobile Device Service (AMDS) on Windows

  • Itunes tells me the iphone can not be used because the required software is not installed

    please someone tell me how to fix this i just want to put music on my iphone 4s

    Let's try a standalone Apple Mobile Device Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of why it's not installing under normal conditions.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleMobileDeviceSupport.msi (or AppleMobileDeviceSupport64.msi) to do a standalone AMDS install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleMobileDeviceSupport.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If so, can you get a normal iTunes install to go through properly now?
    If instead you get an error message during the install (or uninstall), let us know what it says. (Precise text, please.)

  • Some of the songs I have downloaded onto i tunes won't play when I select it to do so.  The error message I get is "The song could not be used because the original file could not be found.  Would you like to locate it?"  How can I get my songs to play?

    Some of the songs I have downloaded into i tunes won't play when I select it to do so.  The error message I get is "The song can not be used because the original file can not be found.  Would you like to locate it?"  When I select yes I'm sent to a screen that has my i tunes library listed.  When I select the song in question I'm asked if I would like to open the song.  When I select this option I get nothing.  The songs I have downloaded must be somewhere because they are listed in my i tunes library and on the screen I've been sent to.  I can't the songs to play however.  This is not true of all of my songs but it is true of quite a few of them.  Actually, one song is too many.    How do I get my music to play that seems to be locked up somewhere in the computer?

    Presuming they're on your computer, right click on them and then follow the prompts to locate hte file on your computer.

  • Multi-Source Universe - Swapping Connections a disaster-Connection can not be registered

    Dear Experts,
    1. What is the best way to swap connections with in an environment?
    For example, in DEV environment I want to use another environment like integrated environment's DB?
    I have to change all the table owners manually and if I have derived tables and custom LOVs, it's a significant maintenance and error prone.
    2. If I migrate the universe to a UAT or PROD environment often I encounter, the connection can not be registered error
    Please advise

    Hi
    If you have three DB servers (Dev,Test,Prod ) and three bo servers (Dev,Test,Prod ) you need to create three different connections in Dev.
    IN THE DEV SERVER
    1. Create connection (Dev Connection) in  the Dev DB to connectDev DB to BO Dev and then develop the universe.
    2. Create another  connection (Test Connection)  in the Dev DB to connect Test DB to Test BO Dev
    3. Create another connection (Prod Connection)  in the Dev DB to connect Prod DB to Prod BO Dev
    Then while promoting to Test environment, you need to send universe along with connection, but in the connection you need to change the Dev DB connection to Test DB connection ((Test Connection)  (Select the connection -> Click on change connection)
    Then while promoting to Prod environment, you need to send universe along with connection, but in the connection you need to change to Prod DB connection (Prod Connection)
    And once the universe and connection are promoted successfully come back to Dev and change the connection to Dev DB (Dev Connection)

  • The disk can not be read or written to!

    So this is the setup:
    Latest version of iTunes running on the wifes PowerBook under 10.4.X
    I’m using a new 4th Gen iPod Nano and I’m trying to sync the iPod to the library. Its gets about 400meg in and then comes up with error ‘The disk can not be read or written to etc etc...’ It stops at the same time every time.
    The library is split between 70% CDs and the other 30% is are tunes copied over from my iTunes library.
    I’ve authorised her Mac to play them so there should be no issue there (I think) as purchased tracks do play in her iTunes.
    I’ve tried repairing permissions
    Restoring the iPod and making sure the FW is up to date
    Changing USB ports
    What else can I try?
    Thanks in advance.

    Hello Sean,
    Have you also tried reformatting the iPod using the tools provided by Windows?
    [Erase Your iPod The Super Fix for Most iPod Problems|http://www.methodshop.com/gadgets/ipodsupport/erase/index.shtml]
    Worth a shot. Hope it helps.
    B-rock

Maybe you are looking for

  • What's the maximum cpu speed?

    My KT3V manual says that I can use 2.8GHZ CPU or higher. Mine is a 1.7GHz one. What's the limit to the above "higher". I have heard that a friend of mine uses a KT3V with a 3.2 GHZ (the latest released by MSI) Thanks for claryfing this to me J. Mulet

  • How to change the interval real substance for DG-Filling

    Hi, Im performing the filling process, to fill the dangerous goods master with data records from specification management. It seems that most data is transferred successfully. Although I receive the following error message in the import log. 1. What

  • Finder window sidebar: clicking folders on server don't 'automount' volumes

    Hello, Xserve 10.5.3, small group of clients, all 10.5.3 I used to have a setup working in which I had a number of some folders on the server that I stored in the sidebar of Finder windows. When I clicked on those folders, it would automatically conn

  • Exporting to Quicktime or movie in IMovie

    When I purchased my mac they told me to export the movie to Quicktime and save to the desktop. That way when I opened Idvd I could drag the movie over to Idvd. It takes an extremely long time for the export to take place. Today I tried exporting to "

  • Cancellation of Service order confirmation

    In IW31 we are creating service orders. That service order is posted in 03/24/2008. When i cancel that service order today it is posting into 03/24/2008. But it has to post in Current date. ( 11/25/2008 ).Can any one tell me why it is happening like