How to successfully connect to Foxpro database files using SQL Server 2014? - sql-server-2014

I am trying to connect Foxpro (.dbf) files to a SQL Server 2014 database. I tried to use linked server option however unable to find the oledb provider enabled for Foxpro.

The VFP OLEDB provider can be freely downloaded from Microsoft but it is only available for 32 bits.
There is no 64-bit OLEDB provider for VFP, and hence you can only use Fox data directly in 32-bit instances of MS SQL Server. For a 64-bit server you'd basically have to link to a separate 32-bit instance of SQL Server in which the Fox DBFs are linked via the OLEDB provider.
This sort of works, and we've been using something like this in production for years (with SQL Server 2014). However, it is a supremely awkward setup that tends to leak little TMP files by the thousands, at least in connection with Reporting Services. On the whole you might be better off with solutions that don't involve DBF access from within SQL Server...
P.S.: whenever I can get away with it, I use Fox to keep the data in SQL Server up to date instead of linking DBFs. With SQLEXEC() this is much less painful than using e.g. C# to access data, and performance is only limited by your Fox data massaging skills. For bulk upload of data, Fox can blast out CSVs and then run sqlcmd/bcp on them (or again SQLEXEC(), as the case may be).

Related

Unable to access Visual FoxPro database through MS Access 2013

I am trying to access a Visual FoxPro Database through MS Access 2013 on a Windows 7 Machine, but I am getting this error.
"specified driver could not be loaded due to system error 0. The operation completed successfully(Microsoft Visual FoxPro Driver C:\Windows\system32\vfpodbc.dll).(#160)"
I tried installing Microsoft OLE DB Provider for Visual FoxPro 9.0 SP2 but I am getting the same results.
Any help is much appreciated.
You cannot use OLEDB with Access, can you? If you can then it is straight forward with VFPOLEDB driver.
You cannot use VFP ODBC driver if database version is later than VFP6.
If you are in a need to downgrade to access (which I never classify as a "database") then you could use Excel in between. Excel can import data using OLEDB (but strangely access can't, go figure). Or if you know how to write VBA code in access then maybe you could utilize the OLEBD driver from there too.
Another option might be to get the data to SQL server express via OleDb, then from SQL server to access (yet a bigger downgrade).
Another option would be to use code for this. If it were from VFP it would be as easy as 1,2,3 creating a cursor adapter or remote view to access and pumping data there. With C# too you can create connections to both sides, read from one and write to the other.
If I were you, I wouldn't choose to downgrade to access, but maybe upgrade to postgreSQL, MS SQL, ...
PS: Check out Advantage Database Server. It was supporting ODBC for VFP (local server version for free). That might be your option.
PS2: Access can import XML, right? Maybe you would want to export VFP data as XML and import from there.

What is the process for importing and viewing a Microsoft SQL Database (.BAK)?

I have always worked with a LAMP stack - I'm a bit lost when it comes to Microsoft.
I have been sent a very large Microsoft SQL file (.bak) and I would like to take a look at it (using something like PHPMyAdmin).
What do I need to do from zero to importing/viewing this database (and what tools should I be acquiring/using in order to do so)?
Help is much appreciated, thank you.
Install MS SQL Server Express
Run SQL Server Management Studio and connect to your local instance.
Using GUI restore your database(SQL Server Express support max 10GB DB).
Now you can see DB Objects using Object Explorer and write custom queries.
If your DB is larger than 10GB download SQL Server Standard/Enterprise trial version.

SQL Server sync to MySQL program

I want to continually sync every 30 mins or less around 380000 rows of data from 11 tables from a SQL Server database to a MySQL database. How can I do this? What programs can do this?
This post, which is often used to close questions like these as a duplicate, does not work for me, for the following reasons.
The SQL Server is part of a CRM system, I'm not sure if it may be a lite version or something, but long story short I do not have access to the SQL Server Management Studio.
The MySQL database is part of my hosting package, which means I have access to it via phpmyadmin and the like, but not to the console or anything. And obviously I cannot access it via localhost.
So basically what I'm looking for is a way to connect to both databases, probably via ODBC drivers, and sync data every x minutes/hours.
I finally used a program called Omega Sync. Now called Spectral Core Replicator.
Omega Sync can compare and synchronize both database schema and table data. Schema comparison and synchronization for databases of same kind
Data comparison and synchronization even for databases of different kind
Compare and Synchronize databases of unlimited size!
Supported databases
Access
SQL Server
MySQL
Oracle
Interbase
Firebird
ODBC sources
I am not associated with this company or product in any way.
Microsoft SQL Server replication can apply the changes to generic ODBC/OleDB subscribers. You can configure MySQL as a subscriber if you follow the right steps and use the correct drivers, but is not officially supported so you are on your own if something goes wrong. Eg. see Set up replication between Microsoft SQL Server 2000 and MySQL. since the article is for SQL 2000 is already deprecated since Microsoft SQL 2008 supports OleDB subscribers, not ODBC.
You will need a very deep understanding of both Microsoft SQL Server, MySQL, ODBC/OleDB and Microsoft SQL Server replication. If you hit errors you'll have to solve them on your own, as the public information on this subject is scarce. I can only tell you that is possible and I've seen it done. Good Luck!

SQL Server 2008 - moving data from SQL Server 2000

Our company is getting ready to move next week and we currently use SQL Server 2000 for all our databases, hosted in our own building. They've decided to move the data to a local company for several reasons, but they are running SQL Server 2008.
I'd like advice on a few things:
We are trying to setup a test for just a few of our databases to see what breaks with our apps (connection strings, etc.). What is the best way to get a database from our SQL Server 2000 box to the new box without losing data or having to recreate the table, etc. I tried the DB Copy Wizard but restrictions within our network don't allow it. If I create a DB on SQL Server 2008 and perform a RESTORE from the SQL Server 2000 .bak file, I will lose all the transactions, correct? What if I replace the transaction files later? I'm thinking that won't work though.
How to properly upgrade a SQL Server 2000 database to SQL Server 2008? I've run the wizard against most of our databases and it came up clean with the exception of a few minor issues that I can resolve.
Our SQL Server 2000 is our production server so it can't go down at any point to copy files.... not until the move. Our customers have been notified that there will be a short outage period between certain dates so that's ok, but I guess what I'm saying is I can't stop the SQL Server Agent right now just to copy log files and such for testing purposes.
Any help/advice is greatly appreciated!
Create a database backup of the SQL Server 2000 and restore it to the SQL Server 2008.
Setup replication making the SQL Server 2000 as the Publisher and the SQL Server 2008 as the Subscriber.
Not sure which would be the best approach. I think a DB backup and restore would be a good idea. You will loose some data in the mean time, though.
If you were migrating between 2 versions of 2005 or 2008 I would advise a log backup to reduce the data lost but I don't think that this option is available on 2000
One piece of advice I can give you is to take a look at the discontinued features from 2000 and 2005 and from 2005 and 2008 on these links:
2005
2008
Just back up 2000, and then restore it. You won't lose transactions, no difefrent to doing a full backup on your current server.
You'll need to add any SQl logins and set the permissions etc.
You'll need to to do fix users for them as well.
If you only use integrated access then you don't need to.
e.g.
Use MyDataBase
EXEC sp_change_users_login Auto_Fix, 'MyUser'
And you'll need to set the compatibility level
Use
exec sp_bcp_dbcmptlevel 'model'
to get it
and then
EXEC sp_dbcmptlevel 'MyDatabase', ??
to set it.
Another option, would be to install 2000 on your new machine restore a back from the old one and then do an inplace upgrade through the 2008 installation wizard. That sort of thing tends to give my sphincters palpitations though.

Error migrating from Access 2007 database to 64-bit SQL Server 2008

I am using 64-bit Vista and I need to migrate an access database, in Office 2007 to SQL Server.
I don't want to have to write an SSIS package to do this, but that may be my only option.
Is there any other way to do this? I have about 330M of data in Access that needs to be moved, so I can write a webapp to replace this database.
Update: The error is:
The upsizing Wizard does not work with the version of Microsoft SQL Server to which your Access project is connected. See the Microsoft Office Update Web site for the latest information and downloads.
In Access, use the upsizing wizard under tools menu...
Edit, checked to see if it's still there: it has issues with SQL Server 2008.
Do you get the same error? (yes you do, says your edit)
Alternative: SSMS/Migration for Microsoft Access
See if creating a Linked Table inside Access DB (which points to your destination table in SQL Server) helps.
OR
See if you can use SQL Server functions (such as OPENROWSET) to open the Access tables.
The SQL Server 2008 Import/Export tool has worked great for me for migrating tables as well as data. You may need to install the SQL Management Studio to get the import tool also (it'll show up in your Start menu). It supports moving tables/data around from various sources, and I'm guessing that Access 2007 is supported.
That said, the SSMS/Migration for Microsoft Access tool may work the best overall.
Best of luck.
When all else fails, you could try creating an ODBC DSN for your SQL Server and then export the tables to that DSN. It won't get all the datatypes right, but it might be good enough to get things started if nothing else works.
I think it's pretty amazing that you can export a Jet/ACE table to an ODBC data source, to be honest.