URLEncode in MS Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Milan Mehta
    New Member
    • Nov 2007
    • 10

    URLEncode in MS Access

    I want to send sms from my ms access 2007 application. I want to make use of a web site to send the sms. The code provided by the web site requires me to use server.URLEncod e. But it seems the same is not available with MS Access. Is there any work around ?

    I have been given following code :

    --------------------------------------------Cut--------------------------------------------------
    ''''wirte code for loop while (you can open record set here)
    sResponse = ""
    sResponse = SMSSend(pno, message )
    If right(sResponse ,15) = "Send Successful" Then
    'write your code here
    End If
    '''End Wend
    Function SMSSend (strPh,strMsg)

    Dim msgResponse
    Dim strRequest
    Dim strUrl
    msgResponse = ""

    strPh=right(str Ph,10)
    If not IsNumeric(strPh ) Or len(strPh) <> 10 Then
    msgResponse = "Enter valid Mobile Number."
    End If
    If strMsg = "" Then
    msgResponse = "Enter text message."
    End If

    strUrl = "http://bulksmsindia.mo bi/sendurl.asp?"
    strRequest = strRequest+"&us er=profileid"
    strRequest = strRequest+"&pw d=pass"
    strRequest = strRequest+"&mo bileno="+strPh
    strRequest = strRequest+"&ms gtext="+Server. URLEncode(strMs g)

    strUrl = strUrl+strReque st

    If msgResponse = "" Then
    Dim oXML
    Dim sPage
    Err.Clear
    On Error Resume Next
    Set oXML = Server.CreateOb ject("Msxml2.XM LHTTP")
    oXML.Open "get", strUrl , false
    oXML.Send
    msgResponse = oXML.ResponseTe xt
    Set oXML = Nothing
    End If

    SMSSend = msgResponse

    If Err.Number <> 0 Then
    SMSSend = "Problem on sending sms : "& Err.Description
    End If

    End Function
    ----------------------------------------Paste---------------------------------------------------
Working...