Release Update IP Address - 3.55 Only (VB6 for XP Machine)

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
Update IP address on 3.55 server - only updates the External IP - not all the others.

Written in VB6 for use on XP machine.

Type in your SQL username and password - add your server name (as shown in TBL_SELECTGATEIPS) and click "Update IP's". Any issues, give me a shout :)

www.sting3g.com/patches/IPUpdate355.rar

Code:
Option Explicit

Private strHTML As String
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Cn As New ADODB.Connection
Public Rs As New ADODB.Recordset

Public Function ReadDataRecord(fldName) As Variant

    If Not IsNull(Rs.Fields(fldName).Value) Then
        ReadDataRecord = Rs.Fields(fldName).Value
    End If

End Function

Public Sub TerminateConnection()

    If Cn.State = adStateOpen Then
        Cn.Close
        Set Cn = Nothing
    End If
  
End Sub

Public Sub InitConnectionSQL()

    Cn.Provider = "SQLOLEDB.1"
    
    Cn.ConnectionString = "Data Source=127.0.0.1;User ID=" & Text2.Text & ";Password=" & Text3.Text & ";Initial Catalog=Account"
  
    Cn.Open

End Sub

Private Sub Command1_Click()

    Dim strTableName As String
    Dim strFilePath As String
    Dim bytChannel As Byte

    Call TerminateConnection
    Call InitConnectionSQL
    
    strTableName = "TBL_PUBIPS"
    
    Set Rs.ActiveConnection = Cn
    Rs.LockType = adLockOptimistic
    
    Rs.Source = "Select * from " & strTableName & " WHERE FLD_DESCRIPTION = 'LoginServer'"
    
    Rs.Open
        Rs!FLD_PUBIP = Text1.Text
    Rs.Update

    If Rs.State = 1 Then
        Rs.Close
    End If
    
    strTableName = "TBL_SELECTGATEIPS"
    Rs.Source = "Select * from " & strTableName & " WHERE FLD_NAME = '" & Text4.Text & "'"
    Rs.Open
        Rs!FLD_IP = Text1.Text
    Rs.Update

    If Rs.State = 1 Then
        Rs.Close
    End If
    
    Call TerminateConnection
    

    Kill "C:\Mud3\mir3server\HolleyDBSvr\!ServerInfo.txt"
    strFilePath = "C:\Mud3\mir3server\HolleyDBSvr\!ServerInfo.txt" 
    bytChannel = FreeFile                                               
    Open strFilePath For Append As bytChannel        
        Print #bytChannel, "127.0.0.1," & Text1.Text & ":7200"
    Close #bytChannel                                     


End Sub

Private Sub Form_Load()
    
    If Inet1.StillExecuting Then Inet1.Cancel

    strHTML = Inet1.OpenURL("http://checkip.dyndns.org/")
        
    Text1.Text = ExtractIPs(strHTML)
       
    
End Sub