Database solution based on MS Access - c#

I have a pretty strange question for you:
At my office, my colleagues save data in a shared Excel document, which crashes very often due to the shared file format, and the many users who use it at the same time.
I tried to create an Access based solution with forms, and it worked pretty well, until it turned out - in the middle of "development", half of my colleagues have x64 OS and the other half have x86 architecture, so most of the VBA code cannot be used - smaller problem - , and the published code is not executable on x64...
My question is: If I build a Windows form that connects to a backend Access database, can I get rid of the x64-x86 problem? Saving to database file will be faster/safer than using the Excel format or I can start everything from scratch after 4 weeks of usage of the access solution? (Probably 20 users max)
And here comes the fun part...I have to cook from what I have :D I have no available SQL server, no Visual Studio at the office... so I have to build a portable WinForm with app configs at home to connect to the access database, saved at our shared network.
What do you think is this possible solution? Or should I try to find a different one?
Many thanks in advance:
Matt

Related

New C# project cannot open ACCDB microsoft database file

I recently had a new project assigned to me (I'm new to C# and I'm a junior). It makes use of a Microsoft access database file (.accdb file)
I've imported the project into Visual Studio but I can't for the life of me run the code. Initially I had file register issues, and I think I managed to resolve that by getting the IT teams to install a "2007 Office System Driver: Data Connectivity Components" driver from the Microsoft website.
Bow the error says:
System.Data.OleDb.OleDbExceptions: 'Cannot open database''. It may not be a database that your application recognizes, or the file may be corrupt.'
The team I'm trying to help only has one dev (working from a different country) who is the main person to handle the code. It works on her side, but she doesn't really have the experience to help me troubleshoot this.
I tried sending her my database file, for her to swap her file for mine, and she said it was still working, so it sounds like the issue might not be to do with the file?
Could I get any help if possible? So far my only approach is to keep googling the error.
But the only resolutions I see are from people who have database files nearing their file size limit (2GB). My database file is just 1MB.
The database file is password protected (the password happens to be in the code). I opened the database file (Microsoft access opens) and entered the password and I had no issue accessing the data)
Out of luck, I managed to find the right article to help me!
The issue with Microsoft access database files is only one user can really use then at a time I believe.
I saw a forum about potential locks made by other users. I googled how to remove locks but it seems that it might not be a lock issue (Microsoft creates a lock file which I dont have).
Regardless, I assumed that the issue is still somewhat similar. Since I had access to the database in Microsoft Access, I decided to open a new database, then go to external data tab and click on access to import EVERYTHING from the other file. Then I just renamed to old file and give my new file the original name.
I reran the code and it worked!
I dont know why the other dev had no issue opening the file. My assumption is that because she is the only developer her laptop is already 'set up' in some way to run everything as normal, whereas if someone new tried (or if something happens and she has to re-open the code on a new laptop) they would have to try and replicate the 'set up' or try and work from scratch
Hope this helps

Running application on a locked down Win10 machine

I've got a small program I made to improve on simple work efficiencies. In effect it's just an application that has direct links to applications and websites, allows text input and formats it appropriately so this information to be stored and recalled quickly.
This has been running for years on our corporate machines (running Windows 7 and 8) just by emailing the .exe to myself with a password protected zip and starting it on the machine, but we're now upgrading to Windows 10 machines and these are locked down to the point where no foreign software can be ran. I know the reasons for this are security, but I am looking for a way around it or alternative way of deploying the software.
I am looking into getting the software authorised for use, but in effect this will be unlikely given how often I update and change things on it (or business changes frequently in terms of process and operation) - it would just be inconvenient.
It's a C# program. NET 4.5.
I can't get admin permission on these machines. Is there anything I can do?
Thanks!
If you cannot run untrusted applications, then instead build your solution within another product that you can use.
For example-- you can probably do all of your direct links to websites and any text input / reformatting you might need with javascript entirely within an html page. Open the .html file with your browser and there you have it.
You can also do many things with VBA scripts in Excel or Word documents.
You may also be able to use powershell to do your automation.

Is it possible for IIS 8 to query a database according to an URL in order to make a redirect?

Please, have patience if this question is long but I have never worked on this complex program which was developed by colleague of mine before I was recruited.
We have this web application running on .NET Framework v2.0 CLR. Anyway, this program is not natively written in C# but we must use a framework called Instant Developer which converts the code in a .NET application. The application runs in a Windows Server 2012 R2 under IIS 8 and with SQL Server 2014.
So, inside this application there is a very big directory called "photos" which contains a photo of each work a user completes. When the program was developed, our customer told us that very few photos were compulsory so my colleague thought that a unique directory was enough. But in this years the requirements have changed. Therefore, now a photo must be take for each work and so that directory today contains more than 5 millions of files. Consequently, it is not openable anymore by Windows Explorer, if I try the server blocks. Last month, our server was attacked by a crypto locker and my bosses decided to pay in order to get a decrypter otherwise our customer will ask us to pay a fine for each file which was lost. As soon as we have finished to recover our files, my boss asked to divide this huge directory into sub directories like /year/month/day. This can be easily done by a python script but the problem is that our customer registered in SAP a link to see that photo of this form
https://www.ourserver.it/applicationName/photo/file.jpg
and they told us they will refuse to change it.
So, I would like to change the path of the photo in the database and, somehow, give instructions to IIS 8 in order that when it receives a URL like the previous, it should query the database, discover the new path and then redirect the client to a new URL like:
https://www.ourserver.it/applicationName/photo/year/month/day/file.jpg
This event is not catchable by the framework we use, that's why I need to program IIS in this way.
How can I achieve this? I don't care if I have to write code, not a problem. But if this could be done reasonably without going mad I would really appreciate your help.

VS2015 New web form pages created empty

Ive been away from .Net web dev for a few years and am now coming back to it inorder to update a client project. I've installed VS Pro 2015(legit no cracks) and am now experiencings some odd behaviours both with the project/website files and VS.
The first 'issue' I need to tackle is that when adding a new master page or webform to the project, these new documents appear completely empty. There is no code or markup generated in the documents eg: 'docname.master', 'docname.master.cs', 'pagename.aspx', 'pagename.aspx.cs'.
I doubt this is the correct, behaviour since it wasn't in the past. So have things changed, and this is expected, and I need to get up to speed. Or, is there something wrong with my set-up -which I expect- ? If so, do you have any ideas what I'm doing wrong? What can I do to rectify this?
UPDATE
I've just done some testing on a different machine and it appears that this seems to be connected to the fact that the files I've been working with are located on a network file server. Is this a known issue, and are there any fixes/workarounds?
In my case it turns out that the cause of this and several other issues was purely down to the fact that the project files I was working with were located on a network drive.
It appears that this is a fairly common problem, especially when access to the network / remote drive is quite slow.
Simply switching the project files to a local drive fixed all the problem I was experiencing.

Excel automation in WCF

We have developed two projects WCF and ASP.net Website.The WCF service consists of code that performs excel generation
it has something like
Excel.Application xlapp=new Excel.Application();
xlapp.visible=true;
//get data from dataset and process it and then write it to excel
This WCF service is hosted in my ASP.net website on a click button in web page
However when I run this service and asp.net on IIS 7 whole lot of error's are generated
few of the errors are as follows
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005."
Then after giving permissions
Application. Microsoft Office Excel cannot open or save any more documents because
there is not enough available memory or disk space. • To make more memory available,
close workbooks or programs you no longer need. • To free disk space, delete files
you no longer need from the disk you are saving to
because of all these errors I am not able to run excel on IIS 7
I have tried all the methods right from Permissions to Authentication but it generates error
I am running XP on my local machine and Win 7 on IIS machine (Is this the problem of WIN 7?)
also this link says Server side Office automation is not supported at all
Isnt there any simple approach to start excel in IIS 7 ?? Or may be I should call excel in my ASP.net website than the WCF service...
Thanks all
Automating Excel should be done with the OpenXML library if possible, since it does not require an instance of Excel to be running, which is questionable at best for server-side processing.
Bas Brekelmans is right. You should go for OpenXML. I spend something like 2-3 days looking for a solution. There are many work arounds. Creating a new path in System32/SysWOW64.
http://social.msdn.microsoft.com/Forums/en-US/b81a3c4e-62db-488b-af06-44421818ef91/excel-2007-automation-on-top-of-a-windows-server-2008-x64
Another solution is through dcomcnfg.exe -> Component Services->Computers->My Computer->DCOM Config->Microsoft Word->Right Click->Properties->Security&Identity.
You'll find a lot of questions about it, but might find 1-2 replies which work.
I've one server which works properly with the Automatisation of Office, on the other server it doesn't, can't tell you why. Been troubleshooting for weeks the issue.
Also server-side automatisation is a feature that isn't supported by Microsoft Servers(shouldn't be).
Also, look under which version you compile your project, if it's x64 or x86.
Bas Brekelmans and mike27015 are right.
You should never go for COM component in asp.net project.
Better to use OpenXml library or some third part library like NPOI
NPOI is free and supports both xls and xlsx(open xml) type.

Categories