I'm creating an inventory system right now but I want to put the my access database in a network access storage that is encrypted, how can I access my database using connecting string function in vb.net to code the username and password, to access my database?
Related
I have a problem when centralizing a database. (I will not use MySQL etc.. since this is only a small application. I will use access only.)
Problem: Code won't run because there is a password on a network.
Based on www.connectionstrings.com this is my connection string:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\server\share\folder\myAccessFile.accdb;
This code can access the database on a network, but only after I manually access the file and input the password.
Is there a way to input a network password using code in VB.NET?
Note:
I tried this search on this website: "access database on a network with a password in VB.NET" but no luck or my query is incorrect
I am using classic asp and trying to access to a remote sql server.
Even though I am specifing which database is default, connection is trying to access another database and yes, user does not have access to it.
I double check user properties where the default database is correctly set and mapped. Here is my connecting string..
Driver={SQL Server};Server=1.1.1.1\SQL2005;Initial Catalog=DEFAULTDB;UID=XXXX;PWD=XXXX
We sorted it out. DBA told me that while using X database, the trigger is using another database too. So we had to authorize for that database and problem was solved.
Thank you for your contribution.
I have extracted data from SQL 2012 to a new copy in SQL 2012 in same PC as well, in original database users can access website using their username and password, but when I try to use copied database, users cannot access into website.
Notes:
1- If I add a new user into copied data, it works fine. But If i try to access using extracted data, it will not work and no error shows.
2-original database connection was using server authentication and the copied database is using windows authentication. May I know what caused that and how to solve ?
I used Navicat Premium to create the database file and selected encrypted to put a password. Now when I try accessing the database in my vb.net program I get an error saying...
file is encrypted or is not a database
"Data Source=\\10.10.10.10\Folder\database.db;Password=pwd;Version=3;", True
The above is my connection string (please ignore the network path =) ). Anyway, I can get through opening the connection but when reading data I get the error. I tried creating another database that doesn't have a password and it worked fine. I even copy pasted the password I have in code to navicat to make sure i typed it correctly.
How can I modify an Sql Server database properties to make it public so that all users within the network can read and write to it? (they will do so through VBA code)
The method I used until now was granting access from DB Security to the network logins/users.
Desired method: I would like to have the database as public and alter the VBA code so that some actions are allowed/restricted based on network username.
What I would do is retrieve the user_id of the user in VBA with
environ('username')
and access the database via a server script.
Create table where you store the users of your internal network (via Active Directory you could use LDAP, otherwise you store the id's yourself);
Create an Ajax call from VBA to the server script and check if the user exists;
I refer to this answer I formulated before on how to create the Ajax call:
Updating Oracle Table from Excel VBA Macro using ODBC connection
Perform all database transactions from the server script (not from VBA directly to the db). You can send the necessary sql criteria with as GET parameters with the url string (check the link on how to do this via Ajax);
Additionally you can embed an extra security by sending a self created key from the vba tool to the server script (this can be hard coded in the VBA code) and verify this before performing any supplementary actions.
This in order to verify if the VBA tool at the client side should have access to the script.