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
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
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
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)
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
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)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum