Web Page Opening

SjCc

Registered User.
Local time
Today, 01:51
Joined
Oct 5, 2017
Messages
67
Hi

I am trying to execute http web page through access 2010 form without opening web page... say its a text message to parents when paying fee .. so there is no need to open web page... i will do it through command button
 
Hi

I am trying to execute http web page through access 2010 form without opening web page... say its a text message to parents when paying fee .. so there is no need to open web page... i will do it through command button


below is the function i am using but it is opening web page and i dont want to open page ......

Function OpenDocument(ByVal strURLLink As String) As Boolean
On Error GoTo Catch

'' This opens the link in the default program or web browser of your computer.
Application.FollowHyperlink (strURLLink)

OpenDocument = True

Exit Function

Catch:
OpenDocument = False
MsgBox "Error#: " & Err.number & vbCrLf & vbCrLf & Err.Description
End Function
 
I am trying to execute http web page through access 2010 form without opening web page

What exactly does 'execute web page' mean? It's not an EXE file.

If you just want to read part or all the web page without opening it, you can adapt the code in this example app Web Version Checker
 
What exactly does 'execute web page' mean? It's not an EXE file.

If you just want to read part or all the web page without opening it, you can adapt the code in this example app checker/4594398125"]Web Version Checker[/URL]

i am running sms web page to sent sms to the parents when they pay fee.. so when i am hiting the command buttion it is opening page and i donot want to page to be displayed i just want this to be done silently without any display
 
Sorry. Still not clear.
Are you saying you want to include the web page address in your SMS? Or copy the entire web page in your SMS (surely not!)
 
Sorry. Still not clear.
Are you saying you want to include the web page address in your SMS? Or copy the entire web page in your SMS (surely not!)

I have a API given by my SMS service provider, now i added this API in DB with command button this web page is opening correctly and sending sms,

now;

i want if i click button so the sms must be sent but i dont want to open page

more simple how to hide opening web page through this vba
 
Application.FollowHyperlink will always open the web page

I think you should ask your API provider for additional info on this.
My approach to sending SMS from Access is very different - see Twilio link given in previous thread. Was that useful to you?

Not sure why you've started another thread which continues on from this. Shall I merge them for you?
 
Last edited:
Application.FollowHyperlink will always open the web page

I think you should ask your API provider for additional info on this.
My approach to sending SMS from Access is very different - see Twilio link given in previous thread. Was that useful to you?

Not sure why you've started another thread which continues on from this. Shall I merge them for you?

Any other option as this sms provider is my local and its my choice .. could you tell me another option to just execute web site on back end
 
You still haven't explained what 'execute a web page' means
 
Why are you not asking the sendpk support people?
They have a chat option and presumably there will be a way to not display the web page.
They would be the experts on their API.?
 
Here is VB6 code from the manual?
Perhaps you can adapt that.?
Code:
Dim [COLOR=#000000]message [/COLOR]As String
Dim [COLOR=#000000]result [/COLOR]As String
Dim [COLOR=#000000]myURL [/COLOR]As String, [COLOR=#000000]postData [/COLOR]As String
Dim [COLOR=#000000]winHttpReq As [/COLOR]Object
[COLOR=#000000]message [/COLOR]= [COLOR=#808080]"Hello this is a test message."
[/COLOR]Set [COLOR=#000000]winHttpReq [/COLOR]= [COLOR=#000000]CreateObject[/COLOR]([COLOR=#808080]"WinHttp.WinHttpRequest.5.1"[/COLOR])
[COLOR=#000000]myURL [/COLOR]= [COLOR=#808080]"http://sendpk.com/api/sms.php"
[/COLOR][COLOR=#000000]postData [/COLOR]= [COLOR=#808080]"username=923xxx&password=xxx&messsge=" [/COLOR]+ [COLOR=#000000]message [/COLOR]+
[COLOR=#808080]"&mobile=92300xxxxxxx&mask=BrandName&format=xml"
[/COLOR][COLOR=#000000]winHttpReq.Open [/COLOR][COLOR=#808080]"POST"[/COLOR], [COLOR=#000000]myURL[/COLOR], False
[COLOR=#000000]winHttpReq.SetRequestHeader "Content-Type"[/COLOR], [COLOR=#000000]"application/x-www-form-urlencoded"
winHttpReq.Send [/COLOR]([COLOR=#000000]postData[/COLOR])
[COLOR=#000000]SendSMS_Text [/COLOR]= [COLOR=#000000]winHttpReq.responseText[/COLOR]
 
Here is VB6 code from the manual?
Perhaps you can adapt that.?
Code:
Dim [COLOR=#000000]message [/COLOR]As String
Dim [COLOR=#000000]result [/COLOR]As String
Dim [COLOR=#000000]myURL [/COLOR]As String, [COLOR=#000000]postData [/COLOR]As String
Dim [COLOR=#000000]winHttpReq As [/COLOR]Object
[COLOR=#000000]message [/COLOR]= [COLOR=#808080]"Hello this is a test message."
[/COLOR]Set [COLOR=#000000]winHttpReq [/COLOR]= [COLOR=#000000]CreateObject[/COLOR]([COLOR=#808080]"WinHttp.WinHttpRequest.5.1"[/COLOR])
[COLOR=#000000]myURL [/COLOR]= [COLOR=#808080]"http://sendpk.com/api/sms.php"
[/COLOR][COLOR=#000000]postData [/COLOR]= [COLOR=#808080]"username=923xxx&password=xxx&messsge=" [/COLOR]+ [COLOR=#000000]message [/COLOR]+
[COLOR=#808080]"&mobile=92300xxxxxxx&mask=BrandName&format=xml"
[/COLOR][COLOR=#000000]winHttpReq.Open [/COLOR][COLOR=#808080]"POST"[/COLOR], [COLOR=#000000]myURL[/COLOR], False
[COLOR=#000000]winHttpReq.SetRequestHeader "Content-Type"[/COLOR], [COLOR=#000000]"application/x-www-form-urlencoded"
winHttpReq.Send [/COLOR]([COLOR=#000000]postData[/COLOR])
[COLOR=#000000]SendSMS_Text [/COLOR]= [COLOR=#000000]winHttpReq.responseText[/COLOR]



Great it is working for me... please advise me how to fast this process as it seems to slow.. secondly i need to ask that i want this API to read "Message" from my Form textbox "Message" and mobile from my form SendSMS text box "Number"
 
As June7 has mentioned in the other post, concatenate your varaiables with the string required,
In the example one would be message which is already being concatenated. I would be using & though.


Something along the lines of
Code:
Public Function SendSMS_Text(message As String, number As String)
Dim message As String
Dim result As String
Dim myURL As String, postData As String
Dim winHttpReq As Object
message = "Hello this is a test message."
Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
myURL = "http://sendpk.com/api/sms.php"
postData = "username=923xxx&password=xxx&messsge=" & message & _
"&mobile=" & number & "&mask=BrandName&format=xml"
winHttpReq.Open "POST", myURL, False
winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
winHttpReq.Send (postData)
SendSMS_Text = winHttpReq.responseText
Set WinHttpReq = Nothing

End Function
then in your form
Result = SendSMS_Text(Me.Message,Me.Number)


As for speed, I'd try changing the code so that you send all the message in one creation of the WinHttpReq object, rather than creating/releasing each time, but as we do not know how your system is structured, it is hard to say.


This is all code I have not used before, so no knowledge. I would be in 'try and see' mode
 
SjCc
I have looked back through this thread and others related to sending SMS from Access. Throughout you have been asked a lot of questions, many of which have not been answered or only partly answered

Firstly, in this thread https://www.access-programmers.co.uk/forums/showthread.php?t=301859 you talked about sending the SMS through a mobile phone connected using Bluetooth. Even if you have got that working, I would urge you to abandon that approach. Dropped connections will occur and you can almost guarantee corruption will follow.

In that same thread I recommended you read this article https://www.access-programmers.co.uk/forums/showthread.php?t=291805&highlight=Twilio. Did you do so? Although some of that was specific to using a specific provider, most of the code was generic and easily adapted for general use.

That was my starting point. I have sent batches of up to 1500 messages at a time using similar code. It works and is very fast. Also used for sending voice messages and for logging received SMS/voice messages.

In this thread, you have been advised by both Gasman and myself to ask your API provider for additional info. They know their system. Why are you reluctant to do so?

Finally you started yet another separate thread here https://www.access-programmers.co.uk/forums/showthread.php?t=301871. I offered to merge it but you ignored that suggestion and have had answers there since.

In summary you've had a lot of support from several people but you aren't making it easy to help you. Please respond to all questions you have been asked ...and contact your API provider.
 
SjCc
I have looked back through this thread and others related to sending SMS from Access. Throughout you have been asked a lot of questions, many of which have not been answered or only partly answered

Firstly, in this thread https://www.access-programmers.co.uk/forums/showthread.php?t=301859 you talked about sending the SMS through a mobile phone connected using Bluetooth. Even if you have got that working, I would urge you to abandon that approach. Dropped connections will occur and you can almost guarantee corruption will follow.

In that same thread I recommended you read this article https://www.access-programmers.co.uk/forums/showthread.php?t=291805&highlight=Twilio. Did you do so? Although some of that was specific to using a specific provider, most of the code was generic and easily adapted for general use.

That was my starting point. I have sent batches of up to 1500 messages at a time using similar code. It works and is very fast. Also used for sending voice messages and for logging received SMS/voice messages.

In this thread, you have been advised by both Gasman and myself to ask your API provider for additional info. They know their system. Why are you reluctant to do so?

Finally you started yet another separate thread here https://www.access-programmers.co.uk/forums/showthread.php?t=301871. I offered to merge it but you ignored that suggestion and have had answers there since.

In summary you've had a lot of support from several people but you aren't making it easy to help you. Please respond to all questions you have been asked ...and contact your API provider.



Hi
Correct and apology straight a way!!!

My dear friend and senior, i am really very newbie in VBA and i have taken a project from my school teacher, in that instant i know i created different but similar threads,, i really say thanks to all of you for your such support i am already have done with all my requirements. I have no time to answer in all threads yes but treating them all with relevant status.

Once again sorry my fellows.. i hope you will forgive me considering a new learner....
 
SjCc
I don't know whether you intended to mark the thread as solved and then delete the thread but I've restored it. Threads with answers should NEVER be deleted as the information may be useful to others in the future.

I hope you will find time to answer questions you have been asked as that's only fair on those who have given up time to assist you.

Also you've just mentioned this is a school project. That's fine but you should have stated this from the outset as it will affect the type of advice give,

Please can you read this info related to responding to advice given in threads
https://www.access-programmers.co.uk/forums/showthread.php?t=296747

Good luck with the rest of your project
 
SjCc
I have looked back through this thread and others related to sending SMS from Access. Throughout you have been asked a lot of questions, many of which have not been answered or only partly answered

Firstly, in this thread https://www.access-programmers.co.uk/forums/showthread.php?t=301859 you talked about sending the SMS through a mobile phone connected using Bluetooth. Even if you have got that working, I would urge you to abandon that approach. Dropped connections will occur and you can almost guarantee corruption will follow.

In that same thread I recommended you read this article https://www.access-programmers.co.uk/forums/showthread.php?t=291805&highlight=Twilio. Did you do so? Although some of that was specific to using a specific provider, most of the code was generic and easily adapted for general use.

That was my starting point. I have sent batches of up to 1500 messages at a time using similar code. It works and is very fast. Also used for sending voice messages and for logging received SMS/voice messages.

In this thread, you have been advised by both Gasman and myself to ask your API provider for additional info. They know their system. Why are you reluctant to do so?

Finally you started yet another separate thread here https://www.access-programmers.co.uk/forums/showthread.php?t=301871. I offered to merge it but you ignored that suggestion and have had answers there since.

In summary you've had a lot of support from several people but you aren't making it easy to help you. Please respond to all questions you have been asked ...and contact your API provider.


Apology straight a way!!!

Any how i am very new to the VB and have some comitment from friend to make a project.. in that instance i made few different but same somehow posts in frustration or in hurry... sorry and thanks for all your support....
 
As June7 has mentioned in the other post, concatenate your varaiables with the string required,
In the example one would be message which is already being concatenated. I would be using & though.


Something along the lines of
Code:
Public Function SendSMS_Text(message As String, number As String)
Dim message As String
Dim result As String
Dim myURL As String, postData As String
Dim winHttpReq As Object
message = "Hello this is a test message."
Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
myURL = "http://sendpk.com/api/sms.php"
postData = "username=923xxx&password=xxx&messsge=" & message & _
"&mobile=" & number & "&mask=BrandName&format=xml"
winHttpReq.Open "POST", myURL, False
winHttpReq.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
winHttpReq.Send (postData)
SendSMS_Text = winHttpReq.responseText
Set WinHttpReq = Nothing

End Function
then in your form
Result = SendSMS_Text(Me.Message,Me.Number)


As for speed, I'd try changing the code so that you send all the message in one creation of the WinHttpReq object, rather than creating/releasing each time, but as we do not know how your system is structured, it is hard to say.


This is all code I have not used before, so no knowledge. I would be in 'try and see' mode

Please tell me where to locate this in form..
Result = SendSMS_Text(Me.Message,Me.Number)
 
Whereever you want to send the SMS message from?
Perhaps a Send button click event, then test Result to see if it was successful?
 

Users who are viewing this thread

Back
Top Bottom