I want Compact a Access DataBase File in C# by Code.
please Help me
Edited: I USe Microsoft Access 2007 DataBase File
The easiest way is going to be by using the standalone program “JetComp.exe” and just calling that from your c# code
http://download.microsoft.com/download/access2000/utility/1.0/win98me/en-us/jetcu40.exe
Another option would be to open a DAO connection to the database and use the .CompactDatabase method. Not being a c# bod I cant really offer a code sample but it is quite easy to do in VBA, for that reason I would just use the first option
I would use Jet Replication Objects (JRO). For example code, see here.
Not a C# programmer...but could you Shell to something like:
c:\myFolder\myAccessDatabase.mdb /compact
This as you can see uses the command line switch /compact.
Related
I am currently migrating a SQL Server database where a co-worker once created this dll using C#, but now I am struggling with it, since I have no idea how I can export mentioned dll, have seen that I need to make a c# function, but I don't understand quite well what I have to do
Does someone have been in the same situation? Do you have any idea how can I achieve this? Thanks a lot I'd really appreciate if you can help me
In sql server management studio, you could right-click the database, choose Tasks->Generate Script. Then search for a line of code that starts with "CREATE ASSEMBLY" - part of that line will be a long string of numbers, which is the dll
In Microsoft Visual Express is there a way to export the SQLite database I've created through the Express interface into a code format so I can have it generated on first install by my customers?
I'd like to take the easiest way to do this without having to manually prepare all the code structure.
I was unable to find any sort of export feature. Any advice?
This resource will help me execute the code once I have it prepared, but I've 12 tables and some of them should come pre-populated, so being able to have the batch code will help.
If it's just an SQLite database you could just publish the file with the rest of your program since it's a normal file without any dependencies.
I just wanted to know whether it's possible to invoke a module function or a macro in MS Access database from outside. Using C#
Thanks
Yes. You can run macros.
This Article (only available via archive.org) shows everything you need.
I'm looking for a beautifier or reformatter for SQL that is written in C# in order to programmatically beautify my SQL output. It does not need to have colouring, but indention and line breaks would be very nice.
Does anyone know of such a component ?
There is now a new option. Check out NSQLFormatter project. On Nuget or Github. 100% Opensource and free.
The below could be an option for you?
SqlParser
Okey here's the situation: I've got a microsoft excel macro in vb that I want to call using C#. I've already tried creating a workbook using Microsoft.Office.Interop.Excel, however I don't want to have to run an excel process to run the macro.
So then I thought why not make a vb class library with my code in it so i can still run it and have a clean dll file. It's not needed to keep any sheet related functions since the macro reads a .lua(UTF-8)text file with some advanced regex functions that I just can't get recreated in C#.
Is it possible for me to make the library use interop as well so i can just call the function in my C#? Any examples would be greatly appreciated.
First I assume you are working with VB6 and not VB Script?
I have never worked with VB 6 or earlier, but I think your best be will be to create a COM object and then you can call the COM object from .NET using C#. Here is a quick link I found through BING that I believe will help you get started if this in an option for you.
Walkthrough: Implementing Inheritance with COM Objects (Visual Basic)
I noticed these two statements:
I don't want to have to run an excel process to run the macro
and
the macro reads a .lua(UTF-8)text file with some advanced regex functions that I just can't get recreated in C#
Those two goals are incompatible. The macro relies on excel functions to run. The only way provided by Microsoft to accomplish this is to completely load the Excel app. There is no way to only run the macro.