Dear all, when i run the following code it shows the error
run-time error:'429'
ActiveX Component cant create object
i have also registered vbxmlrpc.dll
what might the problem?
thanx in advance.
run-time error:'429'
ActiveX Component cant create object
i have also registered vbxmlrpc.dll
Option Explicit
Private Sub Form_Load()
Label1.Caption = ""
Label1.BackColo r = &H80000005
Label1.BorderSt yle = 1
Label1.Height = 255
Label1.Left = 120
Label1.Top = 120
Label1.Width = 3615
Command1.Captio n = "Get Time @ Userland"
Command1.Height = 375
Command1.Left = 120
Command1.Top = 480
Command1.Width = 3615
Caption = "Userland Time"
' BorderStyle = 1
Height = 1350
Width = 3945
End Sub
Private Sub Command1_Click( )
Dim linsRequest As New XMLRPCRequest
Dim linsResponse As XMLRPCResponse
Dim linsUtility As New XMLRPCUtility
Me.MousePointer = vbHourglass
Label1.Caption = ""
linsRequest.Hos tName = "time.xmlrpc.co m"
linsRequest.Hos tPort = 80
linsRequest.Hos tURI = "/RPC2"
linsRequest.Met hodName = "currentTime.ge tCurrentTime"
Set linsResponse = linsRequest.Sub mit
Select Case linsResponse.St atus
Case XMLRPC_PARAMSRE TURNED
If linsResponse.Pa rams.Count = 1 Then
If linsResponse.Pa rams(1).ValueTy pe = XMLRPC_DATETIME Then
Label1.Caption = Format$(linsRes ponse.Params(1) .DateTimeValue, "d mmm, yyyy hh:mm:ss")
Else
BugOut "Expecting a datetime to be returned instead received a '" & linsUtility.Get XMLRPCType(lins Response.Params (1).ValueType) & "'."
End If
Else
BugOut "Expecting one return parameter, received '" & linsResponse.Pa rams.Count & "'."
End If
Case XMLRPC_FAULTRET URNED
BugOut "Server returned a fault. Code is '" & linsResponse.Fa ult.faultCode & "', description is '" & linsResponse.Fa ult.faultString & "'."
Case XMLRPC_HTTPERRO R
BugOut "HTTP error encountered. Code is '" & linsResponse.HT TPStatusCode & "', description is '" & linsUtility.Get HTTPError(linsR esponse.HTTPSta tusCode) & "'."
Case XMLRPC_XMLPARSE RERROR
BugOut "XML Parsing Error encountered '" & linsResponse.XM LParseError & "'."
Case XMLRPC_NOTINITI ALISED
BugOut "Weird, the response claims not to be initialised !!!"
Case Else
BugOut "Double Weird, unknown response status '" & linsResponse.St atus & "'."
End Select
Me.MousePointer = vbDefault
End Sub
Private Sub BugOut(ByVal vstrError As String)
MsgBox vstrError, vbOKOnly + vbCritical, App.Title
End Sub
Private Sub Form_Load()
Label1.Caption = ""
Label1.BackColo r = &H80000005
Label1.BorderSt yle = 1
Label1.Height = 255
Label1.Left = 120
Label1.Top = 120
Label1.Width = 3615
Command1.Captio n = "Get Time @ Userland"
Command1.Height = 375
Command1.Left = 120
Command1.Top = 480
Command1.Width = 3615
Caption = "Userland Time"
' BorderStyle = 1
Height = 1350
Width = 3945
End Sub
Private Sub Command1_Click( )
Dim linsRequest As New XMLRPCRequest
Dim linsResponse As XMLRPCResponse
Dim linsUtility As New XMLRPCUtility
Me.MousePointer = vbHourglass
Label1.Caption = ""
linsRequest.Hos tName = "time.xmlrpc.co m"
linsRequest.Hos tPort = 80
linsRequest.Hos tURI = "/RPC2"
linsRequest.Met hodName = "currentTime.ge tCurrentTime"
Set linsResponse = linsRequest.Sub mit
Select Case linsResponse.St atus
Case XMLRPC_PARAMSRE TURNED
If linsResponse.Pa rams.Count = 1 Then
If linsResponse.Pa rams(1).ValueTy pe = XMLRPC_DATETIME Then
Label1.Caption = Format$(linsRes ponse.Params(1) .DateTimeValue, "d mmm, yyyy hh:mm:ss")
Else
BugOut "Expecting a datetime to be returned instead received a '" & linsUtility.Get XMLRPCType(lins Response.Params (1).ValueType) & "'."
End If
Else
BugOut "Expecting one return parameter, received '" & linsResponse.Pa rams.Count & "'."
End If
Case XMLRPC_FAULTRET URNED
BugOut "Server returned a fault. Code is '" & linsResponse.Fa ult.faultCode & "', description is '" & linsResponse.Fa ult.faultString & "'."
Case XMLRPC_HTTPERRO R
BugOut "HTTP error encountered. Code is '" & linsResponse.HT TPStatusCode & "', description is '" & linsUtility.Get HTTPError(linsR esponse.HTTPSta tusCode) & "'."
Case XMLRPC_XMLPARSE RERROR
BugOut "XML Parsing Error encountered '" & linsResponse.XM LParseError & "'."
Case XMLRPC_NOTINITI ALISED
BugOut "Weird, the response claims not to be initialised !!!"
Case Else
BugOut "Double Weird, unknown response status '" & linsResponse.St atus & "'."
End Select
Me.MousePointer = vbDefault
End Sub
Private Sub BugOut(ByVal vstrError As String)
MsgBox vstrError, vbOKOnly + vbCritical, App.Title
End Sub
thanx in advance.