How to programmaticaly change the path of a msaccess linked table - c#

I´m looking for a solution to do so using c#.
I have 2 msaccess db and I copy them to user´s machine at the firt execution of the system. Between these dbs I have a linked table which I need to change the path to the user folder.
I´ve looked around but I couldn´t find anything.
Any help will be appreciated.

I had this problem some time ago while using VBA, which is probably easier to interface with Access than using C#.
However, after trying out several unreliable options I ended up just dropping the link and creating it from scratch. I would first retrieve all options used by the linked table, replace the database location and create a new linked table with those options, imitatng the old link.
After a quick search I found ADO.NET way for creating a linked table and How can I link an external Access table via .NET? that should help you with doing that in C#.

Related

Connecting to SQL Server database with RevitAPI

I'm trying to export Revit data to an external database. What I'm looking for is to use RevitAPI to do the job of exporting. Though if there is a way to do so using Revit's own tools it'll be fine. As long as I can choose and modify the columns in exported tables.
Does anybody have any suggestions?
I've already tried "Revit > Export > ODBC", but this option only exports some default parameters and I can not modify the columns I want in my tables.
I'm also aware of Revit DB Link. It is for subscribed users only so that's not an option here.
You can implement an Revit add-in to access the data you require from the Revit database and manipulate that into the form you require for export. For the actual connection to the external SQL database, you will have to use some additional library. For that, I would suggest searching the Internet for something like sql server .net api.

Mysql database alternatives if Mysql isn't an option

I'm working on an app using Unity. This app is supposed to upload certain simple information at specific points, which is why my original plan was to just connect it to a Mysql database. Unfortunately Unity doesn't support the NET 4.0 framework and nothing I've tried seems to work.
Yes I could use PHP scripts hosted on my web server to add and pull information, but I'd rather do it all from the app itself if at all possible.
The data I need to record is pretty simple, IDs, ints, strings, nothing too complex.
So I'm now trying to look into alternatives to Mysql.
JSON
So far I have gotten SFTP to work (By using the Renci.SshNet library) and the app is now uploading files in my server's home directory. So my original idea was to just create JSON files with the data and edit them remotely.
Is this something that could be done with C#? How? Any specific resources?
The alternative to remote editing would be to download the JSON file, edit it locally, and then upload it again, but that doesn't sound like a very smart idea.
I have found this answer but it's unclear to me if it requires to send the whole JSON file to the server after every edit or if it's possible to just edit it from the app. Some clarification would be great.
SQLlite
I've also looked into SQLlite but I'm also unsure if it could be remotely edited.
I've Googled it multiple times but can't really find any useful information.
What are my options at this point? What should I use if I needed the equivalent of a Mysql Database that can be remotely edited and read?
You can start seeing into Google Firebase project
https://firebase.google.com/docs/database/unity/start
But unity 2018.3 does support Net 4:
https://learn.microsoft.com/en-us/visualstudio/cross-platform/unity-scripting-upgrade?view=vs-2017
https://blogs.unity3d.com/es/2018/07/11/scripting-runtime-improvements-in-unity-2018-2/
https://blogs.unity3d.com/es/2018/03/28/updated-scripting-runtime-in-unity-2018-1-what-does-the-future-hold/

Using a local database

I'm busy writing a small app and I only want a database to load small amounts of data, in other words I don't need the functionality of SQL.
So I've installed filehelpers, but it seems very limited in the sense that I can read/write and even append data, but it seem impossible to delete one row of data in a table?
Does anyone know how to do this with filehelpers or point me to a different solution where I can just add a local db to my app without any other external software required?
PS. My visual studio does not have the "create local db" from the item selection.
For something like this, I'd use an embedded SQLite database. It gives you the best of both worlds, one file database for local data and most of the features of SQL.
See here: https://sqlite.org/
On their download page, they have lots of stuff and a plugin for VS:
https://sqlite.org/download.html

Windows Application or web application for this purpose

I have about 5000 csv file and I want to insert them in a sql server 2008 database.
I don't whether windows application or web application is better.
each csv file is simple a one row with 36 column that will be inserted in an one table in the database.
thanks for your help.
Update 1
This application will be used on a computer that can connect to the database, it is used by the admin just once, in order words, there are people who responsible to write these csv files, then all the files, come to me and I have to insert them in the database
Update 2
Thanks for the user who are trying to help me.
You gave me these options:
bcp
SqlBulkCopy
Windows service
what is the best please? I told you all the requirements, which are very simple.
Depends how you want to use it - if you want to deploy to lots of people so they can upload a file and process it into a database, make it web.
If on the other hand, you only have a couple of users which you can easily deploy an app to, there is a lot less infrastructure required to write it as an app.
Sounds to me, you want to automate the mass loading of lots of files, so windows app is jumping out at me.
All depends on what the overall requirements are.
Based on your edit, write a win app that uses a folder enumeration, reads the records and passes to a SqlBulkCopy object.
based on your comment I would take an aproach like that:
Easy to use gui solution:
1. Make a website for people that are making the csv's
That website would preform and check's that are necesery and display any errors. Error checking is done by the Web service (more future proven imo).
Create a webservice importing the file to database and sending you an email. That way you don't have any work with putting the data into the database
Implement an aproveal mechanism so you need to aprove the new inputs to the database if needed
Easy to implement solution:
Create an application (Console/WinForm/Web) that uses the bcp tool to import the data and handles errors

Windows Search in Taskbar with my own results

I want to provide a custom Search Connector for Windows Search without accessing a php or aspx website. Is this possible? I don't find anything.
It is not possible to create tmp files because of the amount of files. I want to do a db query.
Target: .net (C#)
Here are 2 pics for a better explanation.
What I have
What I want
the 3 source of information come from a external source via database query.
regards Chris

Categories

Resources