Fox Pro 8 - Export to Spreadsheet - spreadsheet

I don't have much programming knowledge, but I have a data set on a CD in the FoxPro format and I need to know if it can be exported to something like Google Docs in the form of a spreadsheet.

If you have any version of FoxPro or Visual FoxPro, you can use the COPY TO command or the Export Wizard to turn each table into an Excel spreadsheet (with some limitations). Excel can open some older format DBFs, so depending how old your data is, you may be able to just open it from Excel specifying "dBase files."
FoxPro tables can also be exported in CSV format, which a spreadsheet should be able to read. Again, you'd need FoxPro for that.
If you have the VFP ODBC driver, you can use to open the data and export it.

Related

Execute .SQL file with VBA

I would like to know if there is any VBA code which allows me to execute .sql files by clicking a button in Excel?
I've been surfing different webs, but all of them showed code which consists into write the SQL query in the macro, despite it isn't what I wanted. So I have stored .sql scripts as files in different folders on my computer and what I want is to run this script by clicking a button in Excel using VBA.
Short answer is no. There is no magic button in Excel that does that. Easiest that I can think of is run/import that .sql to MySQL, SQL Server, Postgres, etc. to become a database. Example using MS SQL Server:
How do I import a .sql data file into SQL Server?
Once you run successfully that .sql into a DBMS, you may use built-in tools of that DBMS to export the tables into Excel. See the link below as an example:
How to Import and Export SQL Server data to an Excel file
It may not be as easy as pressing a button but not as tedious as hardcoding it. I hope it helps.

Excel: Read .dbf file from microsoft query (other sources)

Enviroment: Microsoft Office 2010, Windows 10
I can not obtain this external data from my .dbf file using Microsoft Query, maybe my data source is incorrectly configured but I tried all the drivers that could handle this format, for example "Driver do Microsoft dBASE (*.dbf)", "Visual Fox Pro tables", etc. and choosed all the existing versions (III, IV and 5.0), then I get the error "imposible the access to the table x", so I'm not sure what it's not working here.
Making the connection through this tool from Excel in order to read the file is required but also VBA code are well accepted too.
This is a link to the zonas.dbf file:
https://ufile.io/vuhfk

Storing data in Excel using VB6.0 and then fetching the results to display in text box

I am trying to make an application in VB6.0 using MS Excel as database. I have some textboxes on my VB Form to take input from user. I want to store those values in an Excel file. There will be another form where I want to retrieve the values from Excel and display it in textbox/labels.
Can I use SQL queries for inserting/retrieving the values while using Excel as database?
I just need a sample code for understanding the process. Rest I will try to manage.
Thanks in advance.
It's a poor idea.
While you can treat an Excel workbook as a data source via the Jet IISAM or ODBC Desktop Driver this is really meant for simple importing and exporting and has numerous limitations.
Save yourself some grief and just use Jet 4.0 to create and make use of MDB files. No MS Access is required, Jet 4.0 comes preinstalled and has for a rather long time now.

How to extract data from a database and populate a sheet in Excel

I am storing data in a backend database (PostgreSQL) which is running on a Linux machine. I want to be able to fetch data from the database, and populate a sheet in an excel workbook, so that I can carry out analysis in Excel.
It has been quite a while since I wrote anything in VBA, so I would appreciate some help (or links) in getting started. I would like to know the best way to approach this:
Pure VBA solution OR
Mixture of C# or other .Net language for data extraction logic and VBA for manipulating Excel objects (sheet data population etc)
Any ideas, tips, snippets and/or links that can help me get started on the twin objectives:
fetching data from a backend database (PostgreSQL) into Excel
populating a specified sheet in Excel with the columnar data retreived from the database
will be much appreciated.
If you are just trying to import data, Excel can do that without additional code. Just set up your windows client to connect to your postgreSQL server thru ODBC. (Here's one way guide to setting that part up: enter link description here
Then in Excel (Use a modern version, like 2007 or greater) from the "Data" tab, click on "Existing Connections" to connect to the ODBC connection you set up and pick the tables/data to import into excel. Once the spreadsheet has loaded the data, you can just click the "Refresh All" button to update the data.

Is there a MacOS ODBC driver that reads SQL-command text files?

I've been searching without luck for a MacOS iODBC driver that can read saved .SQL files exported in Microsoft SQL Server format. Does one exist?
We've got a large pile of research data stored in one app that can export as Excel spreadsheets or SQL files (eg, a text file full of SQL CREATE TABLE and INSERT statements). We need to import this data into another app (Stata 9) that runs under MacOS and can import Excel files, its own format, or from an ODBC source. So, I need an ODBC driver that can read plain SQL files as its source. We don't need a driver that actually talks to an MSSQL database, because there is no actual database here; just a plain .SQL file with MSSQL-style commands in it.
Unfortunately, the default MacOS install seems to come with no ODBC drivers whatsoever, not even one for reading flat files or SQLite databases.
The current workflow for moving this data — exporting it from DatStat as an Excel spreadsheet, opening that spreadsheet and fixing it by hand to conform to Stata's need, then saving and reimporting into Stata — is ridiculously labor-intensive and also loses a lot of important metadata like variable descriptions and annotations.
I think that best thing to do here is load the data from DatStat to a database and then load it back into Stata. First, export your data from DatStat to a .sql file. I'm not familiar with DatStat, but if you can do this in bulk or via the command line it would be best. You can access your OS's terminal in Stata by using the -shell- command. After you have a .sql file, say foo.sql, you can use the following Stata code to send it to a database and then import into Stata.
odbc sqlfile("foo.sql"), dsn("DataSourceName")
odbc load, exec("SELECT * FROM CustomerTable") dsn("DataSourceName")
You could even issue a final command to cleanup the tables in the database if you don't think you'll use this database again and you don't want it taking up space. Use something like:
odbc exec("DROP TABLE CustomerTable")
Yes, this will probably be slow if your dataset is large, but it could be nice once your data is in the database because you can query parts of it at a time instead of importing the whole thing.
Lastly, you mentioned that no ODBC driver for Mac exists for MS SQL Server. If that is the case, you may want to install one of the open-source database systems like MySQL or PostgreSQL. I'm not a Mac user but drivers for these must exist for mac.
Good luck!