Moonlighting2
Programmer
To keep things simple, I have stripped out the rest of the code and limited it to the main function, which is to send an SMS message on a click event, via a server that has been set up.
Error message is object required. This happens, of course, at the Set declaration. It's late, I'm tired, beginning to loose it a little and need help please.
Private Sub Command0_Click()
'On Error GoTo Err_Command0_Click
Dim sUrl
Dim sAPI_ID, sPassword, sUsername, sMobileNo, sText
Dim oXMLHTTP, sPostData, sResult
sUrl = "sAPI_ID = "something"
sPassword = "something"
sUsername = something"
sMobileNo = "something"
sText = "This is an example message"
sPostData = "api_id=" & sAPI_ID
sPostData = sPostData & "&user=" & sUsername
sPostData = sPostData & "&password=" & sPassword
sPostData = sPostData & "&to=" & sMobileNo
sPostData = sPostData & "&text=" & sText
Set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
oXMLHTTP.Open "POST", sUrl, False
oXMLHTTP.SetRequestHeader "Content-Type", "application/x-oXMLHTTP.Send sPostData
sResult = oXMLHTTP.responseText
Set oXMLHTTP = Nothing
MsgBox (sResult)
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
'MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
Error message is object required. This happens, of course, at the Set declaration. It's late, I'm tired, beginning to loose it a little and need help please.
Private Sub Command0_Click()
'On Error GoTo Err_Command0_Click
Dim sUrl
Dim sAPI_ID, sPassword, sUsername, sMobileNo, sText
Dim oXMLHTTP, sPostData, sResult
sUrl = "sAPI_ID = "something"
sPassword = "something"
sUsername = something"
sMobileNo = "something"
sText = "This is an example message"
sPostData = "api_id=" & sAPI_ID
sPostData = sPostData & "&user=" & sUsername
sPostData = sPostData & "&password=" & sPassword
sPostData = sPostData & "&to=" & sMobileNo
sPostData = sPostData & "&text=" & sText
Set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
oXMLHTTP.Open "POST", sUrl, False
oXMLHTTP.SetRequestHeader "Content-Type", "application/x-oXMLHTTP.Send sPostData
sResult = oXMLHTTP.responseText
Set oXMLHTTP = Nothing
MsgBox (sResult)
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
'MsgBox Err.Description
Resume Exit_Command0_Click
End Sub