By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,096 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

URLEncode in MS Access

P: 10
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.URLEncode. But it seems the same is not available with MS Access. Is there any work around ?

I have been given following code :

''''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 = ""

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 = ""
strRequest = strRequest+"&user=profileid"
strRequest = strRequest+"&pwd=pass"
strRequest = strRequest+"&mobileno="+strPh
strRequest = strRequest+"&msgtext="+Server.URLEncode(strMsg)

strUrl = strUrl+strRequest

If msgResponse = "" Then
Dim oXML
Dim sPage
On Error Resume Next
Set oXML = Server.CreateObject("Msxml2.XMLHTTP")
oXML.Open "get", strUrl , false
msgResponse = oXML.ResponseText
Set oXML = Nothing
End If

SMSSend = msgResponse

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

End Function
Nov 20 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.