locked
retrieving data from database RRS feed

  • Question

  • Hi,
    my clients hard drive crashed. he was using a vb based program perhaps not confirm.
    now he contact me to install my program. he has two files saved from crashed hard drive,
    Gate08_Data.MDF and Gate08_Log.LDF . he wants me to transfer data from these files
    to my program which he will use now. my program is vfp based free tables.
    can anybody give any idea to retrieve data from these two fiels. can it be done.
    i do not know which sql was installed on clients machine.

    roomi azmi
    Saturday, December 19, 2009 7:16 PM

Answers

  • Hi Roomi,

    copy those two files to any directory of your computer, then start "SQL-Server Management" application, and then rightclick on the "Database" node and choose "attach".  Depending on the used Database-format or the Servers version of that customers SQL-Server it could well be that your SQL7 cannot open those files.
    After that you either create an ODBC connection and open that with a standard RemoteView in VFP, or you could use SQL-Servers Export functionality to get the data into a different format.


    wOOdy
    Microsoft Visual FoxPro Technology Advisor
    Microsoft "Most Valuable Professional" from 1996 to 2009
    Visit my XING profile! Don't know what XING is?

    *´¨)
    ¸.·´¸.·*´¨) ¸.·*¨)
    (¸.·´. (¸.·` *
    .·`.Visual FoxPro: It's magic !
    (¸.·``··*


     

    Tuesday, December 29, 2009 6:34 PM
  • Hi Roomi,
     
    To learn at least the basics of database administration, it's best to press the famous "F1" key and read the helpfile.
    Sorry, but to use a tool you should know about that tool. And that involves learning, which is best done by reading the provided helpfiles.
     
     
     

    wOOdy
    Microsoft Visual FoxPro Technology Advisor
    Microsoft "Most Valuable Professional" from 1996 to 2009
    Visit my XING profile! Don't know what XING is?

    *´¨)
    ¸.·´¸.·*´¨) ¸.·*¨)
    (¸.·´. (¸.·` *
    .·`.Visual FoxPro: It's magic !
    (¸.·``··*


     

    Saturday, January 2, 2010 11:26 AM

All replies

  • You should be able to copy the files, then attach them to a new SQL Server database.
    Craig Berntson MCSD, Visual FoxPro MVP www.craigberntson.com
    Sunday, December 20, 2009 2:20 AM
  • Hi Craig,
    i have installed mssql7 on my computor. i have Gate08_Data.MDF and Gate08_Log.LDF files.
    now how can i attach them to mssql7 database?
    Sunday, December 20, 2009 3:44 AM
  • hi

    i had almost similar problem as you had. try this one maybe it could help. its from dni

    http://www.tek-tips.com/faqs.cfm?fid=5002


    i hope it could serve the puporse


    young_fox
    Monday, December 28, 2009 9:33 AM
  • Hi YoungFox,

    just as a sidenote: That Tek-Tips code is importing an Access database (MDB) whereas Roomi is faced with a MS-SQLserver database (MDF).

    wOOdy
    Microsoft Visual FoxPro Technology Advisor
    Microsoft "Most Valuable Professional" from 1996 to 2009
    Visit my XING profile! Don't know what XING is?

    *´¨)
    ¸.·´¸.·*´¨) ¸.·*¨)
    (¸.·´. (¸.·` *
    .·`.Visual FoxPro: It's magic !
    (¸.·``··*


     

    Tuesday, December 29, 2009 6:28 PM
  • Hi Roomi,

    copy those two files to any directory of your computer, then start "SQL-Server Management" application, and then rightclick on the "Database" node and choose "attach".  Depending on the used Database-format or the Servers version of that customers SQL-Server it could well be that your SQL7 cannot open those files.
    After that you either create an ODBC connection and open that with a standard RemoteView in VFP, or you could use SQL-Servers Export functionality to get the data into a different format.


    wOOdy
    Microsoft Visual FoxPro Technology Advisor
    Microsoft "Most Valuable Professional" from 1996 to 2009
    Visit my XING profile! Don't know what XING is?

    *´¨)
    ¸.·´¸.·*´¨) ¸.·*¨)
    (¸.·´. (¸.·` *
    .·`.Visual FoxPro: It's magic !
    (¸.·``··*


     

    Tuesday, December 29, 2009 6:34 PM
  • Hi Jurgen,
    i already tried. rightclick on 'database' node, there is no option of 'attach' in sql7.
    can it not be done with sql7? are there any procedure to run?

    Roomi Azami
    Thursday, December 31, 2009 7:06 PM
  • Hi Roomi

    Sorry, I do't have SQL7 anymore available for checking.  SQL2008 is the current one and you can download the free Express-Edition, which would be completely sufficient for your needs. (See http://www.microsoft.com/express/sql/ ) You can install SQL2008 parallel to your SQL7, and the provided Management tools should also work with an earlier version of SQL-Server.

     

    wOOdy
    Microsoft Visual FoxPro Technology Advisor
    Microsoft "Most Valuable Professional" from 1996 to 2009
    Visit my XING profile! Don't know what XING is?

    *´¨)
    ¸.·´¸.·*´¨) ¸.·*¨)
    (¸.·´. (¸.·` *
    .·`.Visual FoxPro: It's magic !
    (¸.·``··*


     

    Friday, January 1, 2010 11:50 AM
  • hi Jurgen,
    i have installed sql2008 express as you said. how can i create new database?
    how can i attach my two file .mdf and .ldf to sql2008 express?

    Saturday, January 2, 2010 6:39 AM
  • Hi Roomi,
     
    To learn at least the basics of database administration, it's best to press the famous "F1" key and read the helpfile.
    Sorry, but to use a tool you should know about that tool. And that involves learning, which is best done by reading the provided helpfiles.
     
     
     

    wOOdy
    Microsoft Visual FoxPro Technology Advisor
    Microsoft "Most Valuable Professional" from 1996 to 2009
    Visit my XING profile! Don't know what XING is?

    *´¨)
    ¸.·´¸.·*´¨) ¸.·*¨)
    (¸.·´. (¸.·` *
    .·`.Visual FoxPro: It's magic !
    (¸.·``··*


     

    Saturday, January 2, 2010 11:26 AM
  • Thank you uncle Jurgen,
    i wiil see the help and try to learn as you advised.

    Roomi Azmi
    Sunday, January 3, 2010 7:26 PM
  • ooops sorry sir jurgens, i may have misread roomi's thread



    young fox
    Monday, January 4, 2010 12:48 AM