Closed Thread
Results 1 to 5 of 5

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

  1. #1
    catchsyed is offline Newbie
    Join Date
    Feb 2009
    Posts
    4
    Rep Power
    0

    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. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    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?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    catchsyed is offline Newbie
    Join Date
    Feb 2009
    Posts
    4
    Rep Power
    0

    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 08:17 AM. Reason: add code tags (the # button)

  5. #4
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    reniery is offline Learning Programmer
    Join Date
    May 2008
    Posts
    45
    Rep Power
    0

    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 04:53 PM. Reason: add code tags (the # button)

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. saving data in a database
    By ployo60 in forum Pascal and Delphi
    Replies: 7
    Last Post: 02-20-2011, 11:44 AM
  2. Saving and Accessing an image file to a Resource file: How?
    By oscarocasla in forum C# Programming
    Replies: 4
    Last Post: 02-08-2011, 09:30 AM
  3. Import Excel File into Oracle DB using C#
    By peterstone in forum C# Programming
    Replies: 0
    Last Post: 05-26-2009, 02:47 AM
  4. Saving session into database and use it
    By yonghan in forum PHP Development
    Replies: 9
    Last Post: 02-22-2009, 04:13 AM
  5. saving to database after few seconds
    By iory in forum PHP Development
    Replies: 4
    Last Post: 10-23-2008, 07:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

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