Advertisement

05.28.2008 at 12:49PM PDT, ID: 23439387
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Importing from Oracle to Excel: Include password in connection string

Asked by PeterFrb in Visual Basic Programming, Microsoft Excel Spreadsheet Software, Oracle 9.x

Tags: , , ,

The following routine represents my attempt at importing a single Oracle source table or query into Excel.  I have about thirty tables that I need to link into contiguous Excel sheets.  In the previous incarnation of the routine, I did not include a password, which forced me to enter the password each and every time the routine below was executed.  I thought that adding the password would be easy, but it's proved not to be.  I have not yet been able to make this a seamless transaction: I have received either an error message or the request for my password.  For ease of use, I have designed a string CONST, which I have been manipulating in hopes of finding the right string; but, so far, no luck.  Can you please assist?
Thanks, ~Peter FerberStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
Sub ImportToExcel(MyRange As Excel.Range, strConnection As String, strsql As String, blSeverLink As Boolean, Optional varPassword As Variant)
    Const strConnect As String = _
        "OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;UserID=pferber;Password=ABCDEFG;" & _
            "Data Source=C:\ABC.mdb;Persist Security Info=False"
    Dim MyQryTbl As QueryTable
 
On Error GoTo Err
    Set MyQryTbl = _
        MyRange.Worksheet.QueryTables.Add( _
            Connection:=strConnect, _
            Destination:=MyRange, sql:=strsql)
    'This gap between creating the QueryTable and refreshing it is essential to making sure
    'it works.  Otherwise, the spreadsheet will often populate with the headers and nothing
    'more.
    Call MyUniversalClass.Wait(1)
    With MyQryTbl
        
        'Note: The false indicates that the refresh is NOT a background query: essential
        'for the proper functioning.
        .Refresh False
 
        If (blSeverLink) Then
            'Keep the data, but release the link to the Access table
            .Delete
        End If
    End With
    
Sub_Exit:
    Exit Sub
 
Err:
    Select Case Err.Number
        Case Else:
            Call MyUniversalClass.PrintError(Err, "OpenWorkbook")
            Resume Sub_Exit
            Resume
    End Select
End Sub
[+][-]05.28.2008 at 01:36PM PDT, ID: 21664132

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.28.2008 at 01:42PM PDT, ID: 21664182

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Basic Programming, Microsoft Excel Spreadsheet Software, Oracle 9.x
Tags: Microsoft, VBA, 6.5, Programming as VBA for Excel 203
Sign Up Now!
Solution Provided By: amir22651
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.28.2008 at 03:33PM PDT, ID: 21664887

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.28.2008 at 04:25PM PDT, ID: 21665140

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.29.2008 at 10:01AM PDT, ID: 21671040

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628