|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
Introduction
The attached code library shows a crude method for enabling this functionality. It leverages the fact that a By converting all Using the codeIf you build the solution, a .dll will be created, called DataSetSQLEngine.dll. This exposes a single public class, with a single public shared function, If anything goes wrong, such as an SQL syntax error or IO error, an error will be raised, so you should always wrap these calls in a Dim newDS As DataSet = _
DataSetSQLEngine.DataSetSQLEngine.executeSQLDataset(ds, _
"Select * From myTable.csv as myTable order by dateStamp")
Note in the example that you must reference your tables as aTable.CSV. By default, the ODBC driver looks for files with a .txt extension. There may be an option you can set in the driver to force it to default to .csv; I haven't looked very hard. If anyone finds it, please let me know. The Microsoft Text Driver ODBC driver appears to use the Jet Engine on which Access is built, and seems to support the Access SQL implementation. It would also appear that the standard Access functions are available, which is a bonus. The included project, SQLEngineExample, has a very simple example which will give you a good idea of how the function works. Points of interestAs mentioned, this implementation is quite crude, and will not provide a usable solution in some circumstances. For example, if performance is critical, then this solution fails miserably, as it requires a lot of disk IO and scanning of tables. Also, I have not tested it with many different types of data. You will need to test it well with whatever data you have, before relying on it. When using string values in your queries, ensure you use single quotes; double quotes cause an error. Another limitation is that only If you take the attached project and add more robust error-checking, or improve the usability in any way, please let me know and I will upload it (and likely use it myself!). I would like to take this opportunity to request Microsoft that they add this functionality as part of the .NET History
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||