|
-
August 10th, 2001, 03:41 AM
#1
save new information
i have a small program which consist of many texts boxes and combo boxes. every time the user goes onto the program he changes some of the information how do i save this information when he closes down the program.
-
August 10th, 2001, 03:54 AM
#2
Re: save new information
You may:
store informations in a database (access,sqlserver,oracle.
This if you have a lot of informations, which does not seem your case) or
write them to a file (ascii, binary,random or ini).
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 10th, 2001, 04:03 AM
#3
Re: save new information
how do i write them to a file though thanks for ya help.
-
August 10th, 2001, 04:19 AM
#4
Re: save new information
have a look in help at sintax:
Open file for output as #1
and
Open file for append as #1
or at Api
writeprivateprofilestring and getprivateprofilestring
(ie of using these api
private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (byval lpApplicationName as string, byval lpKeyName as Any, byval lpDefault as string, byval lpReturnedString as string, byval nSize as Long, byval lpFileName as string) as Long
private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (byval lpApplicationName as string, byval lpKeyName as Any, byval lpString as Any, byval lpFileName as string) as Long
private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: [email protected]
Dim Ret as string, NC as Long
'Write the setting to the file (c:\test.ini) under
' Project1 -> Keyname
WritePrivateProfileString App.Title, "KeyName", "This is the value", "c:\test.ini"
'Create a buffer
Ret = string(255, 0)
'Retrieve the string
NC = GetPrivateProfileString(App.Title, "KeyName", "Default", Ret, 255, "C:\test.ini")
'NC is the number of characters copied to the buffer
If NC <> 0 then Ret = Left$(Ret, NC)
'Show our string
MsgBox Ret
'Delete the file
'NOT in your case!
'Kill "c:\test.ini"
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 10th, 2001, 04:28 AM
#5
Re: save new information
the first two lines keep coming up with an error please help
-
August 10th, 2001, 05:16 AM
#6
Re: save new information
Do you mean api declaration is giving you an error?
Put those api in general section of a form.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
August 10th, 2001, 05:19 AM
#7
Re: save new information
The example presume
"c:\test.ini"
exists on your hard disk
if not, create a file in C:\ named "test" and set its extension "ini".
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|