This discussion is archived
1 2 3 Previous Next 36 Replies Latest reply: Nov 13, 2012 10:34 AM by orafad Go to original post RSS
  • 30. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    orafad Oracle ACE
    Currently Being Moderated
    967313 wrote:
    I installed oracle 11g Personal Edition, 11.2.0.1.0, so do I need to install oracle client for this version ? And, oracle 11g personal edition already included oracle provider for OLEDB, right ?
    You'll need 32-bit Oracle client, because your client application e.g. Visual Studio and VB6 apps is 32-bit and 32-bit programs can't use 64-bit libraries (from your PE installation).
    This was already pointed out earlier in this thread.
    For VB6, I need to install client, otherwise not able to connect oracle database ?
    See above.
    Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (32-bit)

    And, the ODAC for visual studio,
    ODAC 11.2 Release 5 (11.2.0.3.20) with Oracle Developer Tools for Visual Studio or ODAC 11.2 Release 4 (11.2.0.3.0) with Oracle Developer Tools for Visual Studio
    ODAC includes the client also, so it's either one, not both.

    Edited by: orafad on Nov 12, 2012 9:44 AM
  • 31. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    970316 Newbie
    Currently Being Moderated
    Hi orafad,
    Kindly assist me on below,
    I encounter a serious issue in my visual studio 2010.
    1. After installed the visual studio 2010 32bit, and oracle 11g Personal Edition, 32bit.
    I right clicked the Data Connections by add connections, I managed to see the oracle provider for OLEDB, and setup this connection called ODBC.orcl in VB 2010.

    2. After few days, I created tables in SQL*PLUS, under command prompt. (NOTED : I unable to access SQL Developer)
    3. Then, I checked the related tables in ODBC.orcl, but I couldnt find the tables where I created in SQL*PLUS.
    4. I tried to check the connection by change data source, I couldnt find Oracle Provider for OLEDB in Data Source, Visual Baisc 2010.
    5. I only can add.Net Framework Data Provider for Oracle, the only choice for oracle database connection.
    6. The tables in ODBC.orcl, such as emp, bonus, are not in SQL*PLUS.
    7. And the tables where I created in SQL*PLUS are not appear in ODBC.orcl, why ?

    First, why I couldnt see Oracle Provider for OLEDB in VB 2010 ? But I can see this when the first time I installed.
    Second, I can confirm both are 32bit, I check this from processes,
    devenv.exe *32 (microsoft visual studio 2010)
    oracle.exe *32(oracle rdbms kernel executable)

    Please advice accordingly, thanks.

    wayne
  • 32. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    970316 Newbie
    Currently Being Moderated
    Hi orafad,

    You'll need 32-bit Oracle client, because your client application e.g. Visual Studio and VB6 apps is 32-bit and 32-bit programs can't use 64-bit libraries (from your PE installation).
    This was already pointed out earlier in this thread.

    Visual Studio is 32bit, and Oracle 11g Personal Edition is 32bit too, so do I need to download client for VB6 ?

    thanks,
    wayne
  • 33. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    CharlesHooper Expert
    Currently Being Moderated
    967313 wrote:
    Hi Sir,
    I installed oracle 11g Personal Edition, 11.2.0.1.0, so do I need to install oracle client for this version ? And, oracle 11g personal edition already included oracle provider for OLEDB, right ?
    For VB6, I need to install client, otherwise not able to connect oracle database ?

    Can I go to the below link and download client for personal edition,

    Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (32-bit)
    win32_11gR2_client.zip(684,581,290 bytes)
    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win32soft-098987.html

    And, the ODAC for visual studio,
    ODAC 11.2 Release 5 (11.2.0.3.20) with Oracle Developer Tools for Visual Studio or ODAC 11.2 Release 4 (11.2.0.3.0) with Oracle Developer Tools for Visual Studio
    http://www.oracle.com/technetwork/developer-tools/visual-studio/downloads/index.html

    Please advice accordingly, thanks.

    wayne
    Wayne,

    Let's take a step back for a moment. I re-read the entire thread and it appears that you started with the 64 bit version of Oracle 11.2.0.1 Personal Edition. You have since switched to the 32 bit version of Personal Edition. You may need to check the PATH environment variable to make certain that the home for the 32 bit Personal Edition is listed first in the PATH environment variable. In the code sample that I provided to you earlier, the OTN forum code replaced the less than and greater than (not-equal) combination with 2 blank spaces - so the code example will not work as presented (it will work if you replace the two spaces with the less than and greater than combination).

    If you want to determine if the everything is installed that is neccesary for database access to work in VB 6:
    1. Create a new VB 6 project.
    2. Double-click the background area of the form that is created by default.
    3. Paste the following code into the Form_Load sub (you should end up in the Form_Load sub when you double-clicked the form's background):
    Dim intResult
    Dim strDatabase
    Dim strUserName
    Dim strPassword
    Dim strSQL
    Dim dbDatabase
    Dim snpData
     
    'On Error Resume Next
     
    strDatabase = "MyDB" 'From tnsnames.ora
    strUserName = "MyUserID"
    strPassword = "MyPassword"
     
    Set snpData = CreateObject("ADODB.Recordset")
    Set dbDatabase = CreateObject("ADODB.Connection")
     
    dbDatabase.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=" & strDatabase & ";User ID=" & strUserName & ";Password=" & strPassword & ";"
    dbDatabase.Open
     
    If (dbDatabase.State = 1) And (Err = 0) Then
        strSQL = "SELECT" & vbCrLf
        strSQL = strSQL & "  SYSDATE CURRENT_DATE" & vbCrLf
        strSQL = strSQL & "FROM" & vbCrLf
        strSQL = strSQL & "  DUAL"
     
        snpData.Open strSQL, dbDatabase
     
        If snpData.State = 1 Then
            If Not (snpData.EOF) Then
                Do While Not (snpData.EOF)
                    MsgBox snpData("current_date")
                  
                    snpData.MoveNext
                Loop
            End If
            snpData.Close
        End If
    Else
        intResult = MsgBox("Could not connect to the database.  Check your user name and password." & vbCrLf & Error(Err), 16, "Oracle Connection Demo")
    End If
     
    dbDatabase.Close
    Set snpData = Nothing
    Set dbDatabase = Nothing
    4. In the code, change MyDB to the name found in your tnsnames.ora file - I believe that name is orcl. Change MyUserID to an appropriate username for the database and MyPassword to the password for that use.
    5. Press the F5 key to run the program code.

    If everything is configured correctly, the current date and time should appear in a pop-up message when the program runs. If an error message appears on the screen, then that message will tell you if anything else needs to be corrected.

    In short, when testing, keep it as simple as possible at first. The above code uses late binding, and without defining the variable types - as such, performance will suffer if the example is used as is in production, but at least you will know whether or not VB 6 is able to communicate with the database.

    In general, the Oracle Client software must be installed on every computer that will use the programs that you develop. I have not installed the Personal Edition of Oracle, so I do not know if the necessary OLEDB drivers are installed by default with that product, or if you must perform a custom install of Personal Edition, making certain that Oracle ODBC Driver 11.2.0.x.0 (not needed for this example code) and Oracle Provider for OLE DB 11.2.0.x.0 are selected during the install.

    Charles Hooper
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.
  • 34. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    970316 Newbie
    Currently Being Moderated
    Hi Charles,
    Thanks for your help on VB6, I have to reinstall VB6 before I try the way you provided.
    However, is possible you give me a help as below,
    Microsoft Visual Basic 2010(Visual Studio 2010) 32bit, Oracle 11g Personal Edition 11.2.0.1.0 32bit, Window7.
    1. After installed visual basic 2010, I right clicked the Data Connections by add connections, I managed to see the oracle provider for OLEDB, and setup this connection called ODBC.orcl in VB 2010.

    2. After the few days, I created tables in SQL*PLUS, under command prompt. (NOTED : I unable to access SQL Developer)
    3. Then, I checked the related tables in ODBC.orcl, but I couldnt find the tables where I created in SQL*PLUS.
    4. I tried to check the connection by change data source, I couldnt find Oracle Provider for OLEDB in Data Source, Visual Baisc 2010.
    5. I only can see .Net Framework Data Provider for Oracle, the only choice for oracle database connection.

    First, why I couldnt see Oracle Provider for OLEDB in VB 2010 ? But I can see this when the first time I installed.
    Second, I can confirm both are 32bit, I check this from processes,
    devenv.exe *32 (microsoft visual studio 2010)
    oracle.exe *32(oracle rdbms kernel executable)

    Please advice accordingly, thanks.
  • 35. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    CharlesHooper Expert
    Currently Being Moderated
    967313 wrote:
    Hi Charles,
    Thanks for your help on VB6, I have to reinstall VB6 before I try the way you provided.
    However, is possible you give me a help as below,
    Microsoft Visual Basic 2010(Visual Studio 2010) 32bit, Oracle 11g Personal Edition 11.2.0.1.0 32bit, Window7.
    1. After installed visual basic 2010, I right clicked the Data Connections by add connections, I managed to see the oracle provider for OLEDB, and setup this connection called ODBC.orcl in VB 2010.

    2. After the few days, I created tables in SQL*PLUS, under command prompt. (NOTED : I unable to access SQL Developer)
    3. Then, I checked the related tables in ODBC.orcl, but I couldnt find the tables where I created in SQL*PLUS.
    4. I tried to check the connection by change data source, I couldnt find Oracle Provider for OLEDB in Data Source, Visual Baisc 2010.
    5. I only can see .Net Framework Data Provider for Oracle, the only choice for oracle database connection.

    First, why I couldnt see Oracle Provider for OLEDB in VB 2010 ? But I can see this when the first time I installed.
    Second, I can confirm both are 32bit, I check this from processes,
    devenv.exe *32 (microsoft visual studio 2010)
    oracle.exe *32(oracle rdbms kernel executable)

    Please advice accordingly, thanks.
    Wayne,

    I am not sure how much help I will be able to provide to you. I have access to the 2005 edition of VB.Net and went through your steps 1-3 above. I then created a new database table and attempted to add that table in the VB.Net project using the pre-created connection. The new table that I created was included in the list of tables that I could select from, so I could not reproduce the problem that you mentioned.

    A couple of guesses:
    * You are creating the table in a different database than the one that is referenced by your ODBC.orcl connection.
    * You created the table with one user, but a different user is referenced by your ODBC.orcl connection. If that is the case, you may need to create a public synonym and grant the user referenced in the ODBC.orcl connection at least SELECT permission on the table.

    With the above in mind, I suggest connecting to the database using a different approach, an approach that is similar to the first method that I suggested for VB 6. I located a demonstration document on Oracle's website (I have not tested the steps outlined) that shows how to connect to the database using this method:
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/GettingStartedVBVersion/GettingStartedNET_VBVersion.htm

    You might have better luck addressing VB.Net problems to a .Net specific OTN forum, possibly this one:
    Oracle Provider for OLE DB

    I believe on a 64 bit development computer, you are able to configure the VB project to target either the X86 (32 bit) or X64 (64 bit) platform. It does appear that the development environment is 32 bit, based on what you posted.

    Charles Hooper
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.
  • 36. Re: Oracle 11g Personal Edition with Visual Basic(Visual Studio 2010
    orafad Oracle ACE
    Currently Being Moderated
    967313 wrote:
    1. After installed visual basic 2010, I right clicked the Data Connections by add connections, I managed to see the oracle provider for OLEDB, and setup this connection called ODBC.orcl in VB 2010.
    Create a new empty file on your desktop, name it TEST.udl.
    Double click on the file. A properties box should open.
    Select the Provider tab. Here you should find a list of OLE DB providers.

    >
    2. After the few days, I created tables in SQL*PLUS, under command prompt. (NOTED : I unable to access SQL Developer)
    ...
    4. I tried to check the connection by change data source, I couldnt find Oracle Provider for OLEDB in Data Source, Visual Baisc 2010.
    First, why I couldnt see Oracle Provider for OLEDB in VB 2010 ? But I can see this when the first time I installed.
    Well, in the first few posts of this thread you stated that you installed "Oracle 11g Personal Edition, 64 bit,". Then you asked if you should "downgrade" to 32-bit PE (meaning, possibly, deinstall and install).
    And recently Charles noted that you actually moved to a 32-bit install.
    Also you may have installed and removed other Oracle products in between.

    Of course OLEDB Provide might have "moved" in the process.
    It is difficult to follow and to know what you actually have there (not counting possible left overs from installs etc.).

    Did you ever think of starting over with a fresh install of Windows?
1 2 3 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points