|
I have this VB6 program which reads and retrieve information or data from a text file as needed. I need to protect this text file which hold my data, is there any way i can encrypt or compressed so that the program can only retrieve the data from the file in order to protect the data inside.
Would be very grateful if anyone could help me on this.
Thanks.
|
|
|
|
|
You can encrypt/decrypt the text file, but you'd have to hold the contents of the file in memory to use it and modify it, then write it back out encrpyted.
You can find a few examples in this list[^].
I highly recommend abandoning VB6 development and moving to VB.NET. Once you get past the learning curve, you'll find that you've been writing code in the Dark Ages.
|
|
|
|
|
Thanks for the response, but the link mention just open the google page.
Well my problem is like i have developed this software which use a text file to hold the data, this text data i need to protect like we made a protection in ms-access using password. I dont' want the user to make changes or directly access the text file but through the software only and only read the data. Is there any way I can encrypt or compressed the text file and open the file through the program while using it. I would be grateful if you could show me how to do this.
Thanks.
|
|
|
|
|
hang_em wrote: but the link mention just open the google page.
Yeah, this is where you start your own research and start following those links and reading what they bring up. You will also find examples with some of them.
I don't have any examples to give you because I abandoned all VB6 developement, in favor of VB.NET, about 9 years ago.
|
|
|
|
|
SQL server 2008 express and VB 6 application.
I worked on the server side but if I run remotely to other machine using either XP or Vista I had an error message:
Run-time error '-2147467259 (80004005'
Cannot open database 'XXX' requested by the login. The login failed
The connectionstring is:
Database=SQLOLEDB.1;Server=.\SQLEXPRESS;Trusted_Connection=yes;Database=sql0007
Thank you
|
|
|
|
|
It sounds as though you have left something open or there is a disconnected dataset.
this[^] may help.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC League Table Link
CCC Link[ ^]
|
|
|
|
|
Tom Bui wrote: SQL server 2008 express and VB 6 application.
Thats a frightening combination.
Tom Bui wrote: Trusted_Connection=yes
You should never use a trusted connection, that passes your credentials to the sever and tries to use them to log on. Set up a SQL type user (in sql server) and use the userid and password to connect.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
When trusted connection is set to True, the driver will use your Windows credentials to log in to the database. If a different user tries to make the connection, that login will fail if the user does not have access permission to the database.
By setting up a separate user and using those credentials, you can set up a multi-user system without having to muck around with the database itself every time you add or remove a user. As an added layer of protection, keep this user ID and its password secret. Provide your users with individual credentials: use the principle credentials to verify them and then continue to use the principle credentials once the user has been validated. Your users should NEVER have access to the id and password used to access the database, ever.
|
|
|
|
|
Dear,
please follow these things
1. Use sql native client for remote database access.
2. open <c:\programdata\microsoft\windows\start menu\programs\microsoft="" sql="" server="" 2005\configuration="" tools="" configuration="" manager=""> on server and set Protocol for Sqlexpress and client protocol (enable for sharedmemmory, TCP/IP, NamedPipe)
3. change your connection string first from remote machines
Provider=SQLNCLI.1;Password=xxxx;Persist Security Info=True;User ID=xxxxx;Initial Catalog=sql0007;Data Source=<your servername\sqlexpress="">
Thanx
|
|
|
|
|
Hi,
How can I find the true size of 1 column.
I have 3 columns First and last are of fix width and the middle is autosize.
The tlp is dock over the complete form. when I resize the form the middle column resize also. but I can't find a way to determen the size of that column.
I already tryed to compare with point2screen of the controls insite the tlp but no luck
Jan
Dim nWidth As Integer = Me.PointToScreen(pRight.Location).X - Me.PointToScreen(pMid.Location).X
|
|
|
|
|
A dirty way to do it would to be create another row in the TLP, with height 0. Drop a label control in the middle column that's Dock: Fill. Now you've the width of the column at any time simple by looking at the width of the label control.
|
|
|
|
|
Thanx for the awnser.
I'll check this too
|
|
|
|
|
Why do you use a TLP here? I would suggest 3 Panels, all properly anchored. The middle Panel's Width would be readily available.
Note: My approach would probably behave differently when the Form gets shrunk so it's total width becomes less than the sum of the two fixed widths you want.
|
|
|
|
|
I'll try something like this
thx
|
|
|
|
|
Hi,
Do you know about the GetColumnWidths[^] method? Although public it isn't shown by VS intellisense as the browsable attribute is false.
Alan.
|
|
|
|
|
|
Hi,
I wrote a competition program. It need a lot of controls that the program create at runtime.
For 10 players it is 10*10=100. That works fast enough but when it is for 50 players 50*50=2500 it is slow.
Any idees of fasting it up.
here is some of the code:
For n As Integer = 1 To nAantalSpelers
For m As Integer = 1 To nAantalSpelers
P(n, m) = New TextBox
With P(n, m)
.Height = nAfstand
.Name = Format(n, "0000") & "_" & Format(m, "0000")
.CharacterCasing = CharacterCasing.Upper
.MaxLength = 1
.Visible = True
.Tag = Convert.ToString(n) & "_" & m.ToString("000")
End With
Me.pPunten.Controls.Add(P(n, m))
AddHandler P(n, m).MouseDown, AddressOf Punten_MouseDown
AddHandler P(n, m).LostFocus, AddressOf Punten_LostFocus
AddHandler P(n, m).GotFocus, AddressOf Punten_GotFocus
AddHandler P(n, m).TextChanged, AddressOf Punten_Change
AddHandler P(n, m).KeyPress, AddressOf Punten_KeyPress
AddHandler P(n, m).KeyDown, AddressOf Punten_KeyDown
Next
Next
There are also 1 aditional Textbox,1 UserControl(vertLabel) and 6 other labels for each player.
Each type of these controls are on differant panels. and these 4 panels are on a tablelayoutcontrol
I'm thinking of changing it all into a grid but that have to wait!
Jan
|
|
|
|
|
Add a Me.SuspendLayout before you start, and a Me.ResumeLayout() when the code is finished.
I are Troll
|
|
|
|
|
Thankx. I did that but stupid me has place the resumelayout to soon now it is a lot quicker
|
|
|
|
|
having thousands of Controls is insane.
|
|
|
|
|
|
when you need a 1D or 2D arrangement of GUI elements, look for a single Control that can do the job.
Example: use a DataGridView instead of a lot of TextBoxes.
If there isn't one that suits your needs, create one. I often start from a Panel, and a little Element class; the collection of Elements is then foreach-ed in the Panel's Paint, MouseDown, etc. handlers to perform whatever needs to be done. "light-weight controls" I call it. Much cheaper, much faster.
|
|
|
|
|
thanxs for that info.
Thats why I wrote in my first question no datagrid. I will change that in the future. but for now it needed this fast. And it is working
I have placed it on the internet
Jan
|
|
|
|
|
Code below:
Private Sub gridload()
Me.File_DataGridView.DataSource = Me.data
retrievedata("SELECT * FROM table;")
End Sub
Private Sub retrievedata(ByVal command As String)
'This will bind the data to the DataGridView'
Try
Dim connection As String = "Data Source = test.db3"
adapter = New SQLite.SQLiteDataAdapter(command, connection)
Dim builder As New SQLite.SQLiteCommandBuilder(adapter)
Dim table As New DataTable
table.Locale = System.Globalization.CultureInfo.InvariantCulture
adapter.Fill(table)
data.DataSource = table
File_DataGridView.AutoResizeColumns()
Catch ex As Exception
MessageBox.Show("There is a problem with retrieving the data for the data grid")
MessageBox.Show(ex.Message.ToString)
End Try
End Sub
I'm trying to bind a sqlite database to a data grid view. The problem usually occurs at data.DataSource = table with this error "Object reference not set to an instance of an object." Any suggestions on how to fix this problem?
|
|
|
|
|
I believe I got it. I changed data.datasoure to datagridview.datasource. Its now fully tested but its not giving me any errors right now. But I do have to get further to test it out.I'll let everyone know if this works.
|
|
|
|