Can't access encrypted sqlite database - vb.net

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.

Related

Connection string with a network password

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

encrypt password - Connect Dreamweaver to SQL server databse

I am trying to set a connection between Dreamweaver and Sql server database,
i am using the wizard under Dreamweaver CS3
the wizard creates a file named connections and inside that file i have
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_Q_S_Conn_STRING
MM_Q_S_Conn_STRING = "Driver={SQL Server};ServeR=\SQL08R2T_INST4;Database=XTEST;Uid= TDWEAVER;Pwd=tdweaver;"
%>
all is working fine and i can access the database and add/delete/update records
The administrator is asking to apply encryption to the password and send him the way the encryption is performed
Can i add encryption to the password inside the Connection String? or maybe add encryption type ?
Any help please
My first question would be: Does the driver encrypt the connection to the database? If not, then what's the point of encrypting the password when the first connection publishes it as plain text on the local network?
The next question: Why can anyone read the file? If only the process can read the file, what additional security does encrypting the password provide?
For me, this feels like security by obscurity which is a valid security layer if you have covered all the other bases. If you didn't, then it's just a waste of time.

Access ODBC Issue: ODBC--Call failed

I created an Access front end for a SQL DB on my PC for use throughout my company. I am using a file ODBC connection and putting both the ODBC file and the Access file on a shared network drive.
When I load the access file, for some reason it seems to default to using my windows login credentials and pulls in the data perfectly. When a user attempts to open the file, they receive an error message saying "ODBC --call failed.". I can open the Linked Table Manager for them and check 'ask for new location' then specify the ODBC file and it all works fine...however it doesn't seem to save anything. I get the error each time someone other then myself opens this file.
Any idea what could be wrong? I am not an Access guy by trade, it just seems to be the tool we need for the moment.
--EDIT: For Clarification I am using a file ODBC connection
--Edit 2--
Riddle me this. So I have been troubleshooting this issue and I came across something interesting. I was logged in as one of my users and did the following:
Create a new access file that references a file ODBC connection on the desktop.
Create 3-4 linked tables in the access file, using the ODBC file on the desktop.
Save and close the access file.
Re-Open said file.... and I get an ODBC connection error! Right after everything was fine in a fresh file!
Anyone ever experience this?
i assume you didn't install the ODBC correctly on each users PC.
you should create the ODBC-definition. You can create the relevant statements directly in the registry, see this branch
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
if you give the same name as on your developer machine, then it works. that's how i do it with my client applications that i develop on my machine and then install it at client site
After beating my head against the wall having this same issue, I finally discovered I had a checkbox on the Access form that defaulted to NULL. Since I put the backend into SQL, the checkbox fields cannot be NULL but the 'ODBC Call Failed' message did not help. I finally tried to add a record directly on the table via Access and it gave more information. I set all the checkboxes to default to zero and it resolved the problem!
Well, I was able to narrow the issue a bit. Access for some reason keeps trying to use Windows Credentials instead of the username in my ODBC file. I can't find a way around it, but I was able to resolve the issue by creating logins on my SQL Server for the windows users that need access.
I am not incredibly happy about needing to manage more logins, but that's what i did to resolve this issue.
I don't mean to resurrect the dead, but I had this same error stem from a different issue.
I was using an ODBC connection. When running the file using the 'Design' run button it worked fine. When I tried using the Navigation Pane and double clicking on it, the error would happen.
The structure of my query was the problem; I was porting a SQL server query over and the single quote ' parameter passing was not well received in Access. Changing these over to double quotes " made it work.

VB.net connection to embedded database

I have a stand-alone Windows Form app written in VB.NET that currently connects to a local Access DB (.mdb file) and consumes data from several of the tables. It never writes to nor modifies the DB. I'm trying to figure out how to secure this DB so the user has no access to it. I'm thinking the best way is to store the DB as an embedded resource within the project. However, I can't figure out how to make this work.
I've added the .mdb file to the project resources and set its properties to "Embedded Resource" and "Do not copy." But now how do I reference the DB to create the connection?
Before I used the connection string "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=MyDatabase.mdb"
How do I write the connection string now with reference to an embedded resource?
"I'm thinking the best way is to store the DB as an embedded resource within the project."
This usually relates to old skool security, in the olden days DotNetNuke developers that used Access dBs as their backend actually renamed the .mdb to .resources as you cant download a resource file from the web.
"Would it be better to export the DB to xml or something like that and then use a stream reader as opposed to a database connection?"
No. You cant read an Access file from a stream And an XML dB has even less concurrency support than an Access Database.
If you really need to protect the data, then you've absolutely chosen the wrong data store.
#JohnBustos wrote "Store the DB remotely and have the program access it over the internet."
Please do not do this. If anything put it on a network share and restrict access. Then look at upgrading the access dB to SQL Server.
Yes, I have had the same problem and I converted the database into a XML or even a TXT file that is embedded. It works very fine !
Sorry, I never closed this out.
My solution was even simpler than those proposed. You can add the .mdb file to the project itself and not mess with the whole "Resource" business. Then set the file's Copy to Output property to "Do not copy". So the .mdb gets compiled into the app, but file itself is not available to the user.

PowerBuilder 12.5 tutorials

I am new to PowerBuilder Classic 12.5. I have created ado.net database profile. How can I now connect to it and create a login window to read username and password, validate and let the user access to the program.
Please help with a sample code and where do I put the codes?
Thanks.
Making the database connection was one of the things that took me the longest to learn, not because it's difficult, but because you do it once and don't have to look at it again.
In your code, you'll need to set the properties of the SQLCA global transaction object. If you have the connection defined in your database painter, then you can right-click on it, choose "Properties", and see what the syntax needs to be from the "Preview" tab.
This syntax will (probably) include your security credentials for the connection. You'll need to build your own userid/password prompt and parse the results into the connection string. I don't have ADO.NET installed, but here's a sample of an ODBC connection... straight copy and paste:
// Profile CINEMA3
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DSN=cinema;UID=UserName;PWD=SuperSecurePassword'"