|
-
Aug 26th, 2004, 01:05 AM
#1
Thread Starter
Hyperactive Member
VB6 and SZ registry entry
Hello everybody
I think I have a rather trivial problem. Unfortunately, I have not been able to come up with a solution. I am trying to create a couple of string (zero terminated) key entries. The string to be entered in the registry comes from a text box on a form (txtServerIP).
When I write the value of the text box to the registry, the value is written as a double word whereas I would like to have it stored as string.
The text box is supposed to store an IP address as a string. Could the periods of an IP address cause a problem?
The code is as shown below :
Private Sub OKButton_Click()
Dim strServerIP As String
strServerIP = txtServerIP.Text
' Check whether key 'SOFTWARE\LEAP_SOFTWARE exists. If not then create key
' 'SOFTWARE\LEAP_SOFTWARE\EPEMBATHS' and set key values. Otherwise just
' set key values.
If RegistryModule.regDoes_Key_Exist(HKEY_LOCAL_MACHINE, "SOFTWARE\LEAP_SOFTWARE") Then
RegistryModule.regCreate_Key_Value HKEY_LOCAL_MACHINE, "SOFTWARE\LEAP_SOFTWARE\EPEMBATHS", "MY_SQL_SERVER_IP", strServerIP
RegistryModule.regCreate_Key_Value HKEY_LOCAL_MACHINE, "SOFTWARE\LEAP_SOFTWARE\EPEMBATHS", "DATABASE_NAME", "biotech"
Else
RegistryModule.regCreate_A_Key HKEY_LOCAL_MACHINE, "SOFTWARE\LEAP_SOFTWARE\EPEMBATHS"
RegistryModule.regCreate_Key_Value HKEY_LOCAL_MACHINE, "SOFTWARE\LEAP_SOFTWARE\EPEMBATHS", "MY_SQL_SERVER_IP", strServerIP
RegistryModule.regCreate_Key_Value HKEY_LOCAL_MACHINE, "SOFTWARE\LEAP_SOFTWARE\EPEMBATHS", "DATABASE_NAME", "biotech"
'RegistryModule.regCreate_A_Key HKEY_LOCAL_MACHINE, "SOFTWARE\LEAP_SOFTWARE\EPEMBATHS\MY_SQL_SERVER_IP"
'RegistryModule.regCreate_A_Key HKEY_LOCAL_MACHINE, "SOFTWARE\LEAP_SOFTWARE\EPEMBATHS\DATABASE_NAME"
End If
Any suggestions?
thx, in advance
George Papadopoulos
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
|