When I first started to learn how to program Windows applications I was mystified by the Windows Registry. I discovered that programs would store information there and most "normal" users would never even know about it. This was the perfect place to store encrypted passwords and things like that. Of course now days the registry is becoming less and less helpful because it has grown enormously and is a pain to move when a computer is upgraded. Still storing a value in the registry, especially program settings or things such as that, can be very helpful. This code snippet shows you how to use Visual Basic's built in SaveSetting and GetSetting commands to store and retrieve data in the registry.
To use this code create a new Visual Basic project, add two command buttons to it, add two text boxes. Go to the code area and add the following source code.
After you have added the source, run your program and you should be able to save and retrieve data from the registry.
Note: The source for this was found at DreamVB which is no longer online.
Private Sub
Private Sub cmdsave_Click()
Set rs = New ADODB.Recordset
rs.Open "select * from table1", cn, adOpenKeyset, adLockOptimistic
rs.AddNew
rs!id = txtid.Text
rs!Name = txtname.Text
rs!age = txtage.Text
rs!address = txtaddress.Text
rs!profile = txtprofile.Text
rs.Update
MsgBox "Saved!"
Form1.clear
rs.Close
Set rs = Nothing
End Sub
help
how to save text in vb6
i use adodc1.recordset.save and
it just clear the text in the text area
How to create a colored
How to create a colored message box in vb6.0
Useful in everyday programming!
This is what I'm looking for my system to work without any database to store my system settings.. Thank you for this very useful information.. ^_^
Mayo akong maginibo
Mayo akong maginibo
Database
please i need to connect the access 2003 to vb6 i need some help.
Thanks
Is your concern already
Is your concern already answered?
if not...
SAMPLE:
Private Sub cmdsave_Click()
Set rs = New ADODB.Recordset
rs.Open "select * from table1", cn, adOpenKeyset, adLockOptimistic
rs.AddNew
rs!id = txtid.Text
rs!Name = txtname.Text
rs!age = txtage.Text
rs!address = txtaddress.Text
rs!profile = txtprofile.Text
rs.Update
MsgBox "Saved!"
Form1.clear
rs.Close
Set rs = Nothing
End Sub
Cool!
Now I can Copy and Paste, AND store and retrieve data from the registry at the same time!!!
Post new comment