Excel File to MsSql by VB6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nitintiwari
    New Member
    • Oct 2006
    • 5

    #1

    Excel File to MsSql by VB6

    Pls can some one give me the code

    I have a CurrentData.Xls file to be copied to a data base though mssql can some one giveme the code

    I have a Database Name Medicine

    CurrentData.xls have 10 Cols and around 2500 Rows how can i copy the excel file into dbf file in the Medicine Database pls give me the query and code

    urgent
  • LacrosseB0ss
    New Member
    • Oct 2006
    • 112

    #2
    I have done something similar using Excel Objects but the Database was an Access database. Unfortunately, there is a lot of nested For Loops and such using Worksheet.Cells (row, col).Value. It gets very tedious but it can be done.

    It has been a while for me since using Excel Objects. I know there's also a few references to add (which slip my mind, they're obvious when you see them). Then it's xl = new Application.Exc el will create the object. I apologize I cannot provide more code but, as I say, it's been a while. Off the top of my head I do not remember.

    As for the database side, I had used an ODBC and connected to that through VB. You will need probably a global variable for a connection string containing database name and user/password (if required).

    I apologize I cannot provide exact code references. Hopefully this is enough to at least make a start. It has been a while for me, maybe someone else can also help. Sorry again!

    Comment

    Working...