+ Reply to Thread
Results 1 to 5 of 5

Thread: Saving a excel file to Oracle Database using vb6.0

  1. #1
    Newbie catchsyed is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    4

    Saving a excel file to Oracle Database using vb6.0

    Hi,

    How do I select a file using common dialog control as we do in RUN in windows OS and on click OK the excel file should be loaded into Oracle Database 10g.

    Please Help

    Syed

  2. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,660
    Blog Entries
    57

    Re: Saving a excel file to Oracle Database using vb6.0

    Moved to the correct forum.

    There are multiple parts to this problem:
    1) selecting the file
    2) loading it into memory
    3) storing it in an Oracle Database

    Which part are you having issues with? What code do you have so far?
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  3. #3
    Newbie catchsyed is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    4

    Re: Saving a excel file to Oracle Database using vb6.0

    Hi

    Issue with

    2) loading it into memory
    3) storing it in an Oracle Database

    code :
    Code:
    Private Sub CmdBrowse_Click()
    cdlgControl.InitDir = "c:\"
    cdlgControl.ShowOpen
    If cdlgControl.fileName = "" Then
    MsgBox " Please select a file to upload"
    End If
    TxtUpload.Text = cdlgControl.fileName
    'CommonDialog1.Flags = cdlOFNOverwritePrompt
    
    End Sub
    
    Private Sub CmdExit_Click()
    Unload Me
    End Sub
    Last edited by WingedPanther; 05-04-2009 at 10:17 AM. Reason: add code tags (the # button)

  4. #4
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,660
    Blog Entries
    57

    Re: Saving a excel file to Oracle Database using vb6.0

    Well, you'll have to create a connection to the Oracle database before you can store it.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #5
    Learning Programmer reniery is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    45

    Re: Saving a excel file to Oracle Database using vb6.0

    You could do something like this
    Code:
    Dim xl As New Excel.Application
    Dim xlsheet As Excel.Worksheet
    Dim xlwbook As Excel.Workbook
    
    Set xlwbook = xl.Workbooks.Open(fileName)
    Set xlsheet = xlwbook.Sheets.Item(1)
    
        
        Do While i <= row
          field1 = insert xlsheet.Cells(i, 1)
          field2 = xlsheet.Cells(i, 2)
          sqlthingy = INSERT INTO table_name VALUES field1,field2
        Loop
    
    xl.ActiveWorkbook.Close False, fileName
    xl.Quit
    
    Set xlwbook = Nothing
    Set xl = Nothing
    Last edited by WingedPanther; 05-04-2009 at 06:53 PM. Reason: add code tags (the # button)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Tutorial: Storing Images in MySQL with PHP
    By Jordan in forum PHP Tutorials
    Replies: 43
    Last Post: 01-16-2010, 10:35 AM
  2. Creating an Executable Jar File
    By TALucas in forum Java Tutorials
    Replies: 12
    Last Post: 01-14-2010, 01:03 PM
  3. problem How to read or download excel file in VFP8-9
    By jov in forum General Programming
    Replies: 2
    Last Post: 11-14-2008, 02:32 PM
  4. text file manipulations in vb6.0
    By Ronin_paes in forum Visual Basic Programming
    Replies: 3
    Last Post: 06-11-2007, 04:54 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts