Open secured password MS access database
Hi,
Question1:
If my MS access data is not secured by a password, I can use this code to open it: Data1.DatabaseName = App.path & "\MyParts.mdb"
Now I set the MyParts.mdb to prompt a password to open it. Of course, that code above cannot open it any more.
Question 2:
I want to highlight whole row (or fileds) of the table where the arrow pointed to the records found.
Question3:
The records found is saved to a text file name Records.txt. I want the program to save or convert the file to .pdf extension so that no one can edit it.
I am a beginner in VB, so any help will be appreciated.
Sincerely,
Mike
Re: Open secured password MS access database
Quote:
Originally Posted by Mike Phan
Question1:
If my MS access data is not secured by a password, I can use this code to open it: Data1.DatabaseName = App.path & "\MyParts.mdb"
Not exactly. That's part of the connection string. Look at these connection strings - for Access and Access 2007.
Quote:
Now I set the MyParts.mdb to prompt a password to open it. Of course, that code above cannot open it any more.
Not unless your program gets the correct password. Use the first connection string and change the right end to
VB Code:
Pwd=" & txtPassword.Text & ";"
Quote:
Question 2:
I want to highlight whole row (or fileds) of the table where the arrow pointed to the records found.
If you're running a VB program the table isn't showing on the screen the way it does when you run Access. You can retrieve a row (or a lot of rows). If you want to display it (them) you'll need a grid or a bunch of text boxes or labels on your form to put the retrieved data into.
Quote:
Question3:
The records found is saved to a text file name Records.txt. I want the program to save or convert the file to .pdf extension so that no one can edit it.
You can buy controls that will write .pdf files. Crystal Controls can write them. VB can't natively write them.