Problem:
A directory of free tables to which I want to connect via C#.
Internet solution:
- Download the Visual FoxPro 9.0 OLEDB driver
- Install (duh :) )
- 'using System.Data;'
- Jump around to Connectionstrings.com and get the correct connectionstring
- Start filling that table!
- string vfpConnectionString="Provider=vfpoledb.1;Data Source=C:\\temp\\fptest\\;Collating Sequence=general;";
- conn = new System.Data.OleDb.OleDbConnection(vfpConnectionString);
- conn.Open();
- System.Data.OleDb.OleDbCommand Com = new System.Data.OleDb.OleDbCommand("[SQL goes here]);
- Com.Connection = conn
- Com.ExecuteNonQuery();
- conn.Close();
'Oh crap on FoxPro... I go to bed'
[Birds chirping] Next day at work:
Installed the same sequence again... WOW! Works! What gives?
Now then... education starting, sit down, be quiet and read up:
If you have, like me, a Vista64 Ultimate at home and a Vista32 Business at work... you get the drift? Yes! No 64bit with the FoxPro drivers! [claps] Very good! Get a Snickersbar and be proud.
Solution? Easy:
- Create your FoxPro-Accessing-Application-to-be
- Go to 'Build' -> 'Configuration Manager...'
- Find your Project (should be easy if you only have one in there)
- Click on the 'Platform' DropDown and choose '
' - 'New Platform' and choose 'x86' and '
>' - 'Ok' everything, make sure 'x86' is set as target CPU
- Build and frolic
'Select * from ste_q3 where current=3.35'
Oh and by the way I recommend DBFManager which is quite a powerful (and inexpensive) way to sniff around in those tables without having FoxPro installed.
I hope I saved at least a bit of someone's troubles with this :)
Oh.. and I just read up on static variables in functions and C#... I go on with that in the next post, because it is a separate thing to rant about :)
No comments:
Post a Comment