locked
Import Data from a Data Base RRS feed

  • Question

  • Hi,

    Has anyone written code to import data from an Access Data Base or a SQL server data base into another Data Base?

    I have a copy of the database so I could specify the structure by using it as a datasource in my LS program.  But, how do I get the data from the client into my program?

    Thanks,

    Dave

    Friday, September 16, 2011 12:46 PM

Answers

All replies

  • From External to Intrinsic is probably a waste, as when you publish, it does not copy the data.

    So I assume you have 1 external DB are your primary and want to copy data from another external db. In that case, I would just add another Datasource to the 2nd external db.  Now you have access to both and query and loop over data in code. Then remove the 2nd external db when your done.  You will have to take care on order of copy because of relations and may have to noodle it out on paper first.

    • Proposed as answer by WilliamStacey Friday, September 16, 2011 11:32 PM
    • Unproposed as answer by WilliamStacey Friday, September 16, 2011 11:32 PM
    Friday, September 16, 2011 9:13 PM
  • Hi William,

    What I was looking for is a way for the Data, which is stored in a Access Data Base on the Client, to be copied into my Sql data base on the server.  I don't think it can be done.  So, I'm thinking of createing a csv file from the client data base and loading that in.

    Thanks,

    Dave

    Friday, September 16, 2011 9:28 PM
    • Proposed as answer by WilliamStacey Friday, September 16, 2011 11:32 PM
    • Marked as answer by Dave Vorgang Saturday, September 17, 2011 9:19 PM
    Friday, September 16, 2011 11:31 PM
  • Dave,

    I did the following:

    1.  Go ahead and define your model / screens in LS

    2.  attach to sql server database

    3.  build your app in LS so that it create the associated database tables in SQL Server

    4.  Use tools that ship with MS SQL Server 2008 to import data into newly created tables.  One such tool is the Import and Export Data tool.  This tool even allows you to perform field mapping, etc.  Also, you can save the import/export script as a SPSS package inside of SQL Server and re-run when necessary. 


    GAD Group
    • Marked as answer by Dave Vorgang Saturday, September 17, 2011 9:19 PM
    Saturday, September 17, 2011 9:01 PM
  • @William, @Gad: Thanks.  I marked you both as Answer.

    In the end I just converted the access db to sql server and then created some view that formatted the data.  Then I just copy/pasted into my production database.  Of course this is not a very good method and I will look into the ones you both suggested.

    Thanks,

    Dave

    Saturday, September 17, 2011 9:22 PM