Access - Ερωτήσεις / Απαντήσεις Access + VBA... Εδώ δεν υπάρχουν όρια!

Απάντηση στο θέμα

 

Εργαλεία Θεμάτων Τρόποι εμφάνισης
  #1  
Παλιά 17-04-13, 20:19
Όνομα: Πάνος
Έκδοση λογισμικού Office: Ms-Office 2007
Γλώσσα λογισμικού Office: Ελληνική
 
Εγγραφή: 01-03-2011
Μηνύματα: 26
Προεπιλογή SMS API

Καλησπέρα! σε αυτόν των κώδικα που βάζουμε το API

π.χ
url = "http://attenzoservices.com/api_http2/http?"
myarr1 = Array("user", "pass", "from", "text", "to", "text")
myarr2 = Array("εδω το user", "εδω ο κωδικος", sender, Sms, txt_receiver)
reply = send(url, myarr1, myarr2)


Option Compare Database
Option Explicit

Private Function GetSMSServerResponse( _
strMessage As Integer, _
strFrom As String, _
strUserName As String, _
strPassword As String, _
strTo As String, _
Optional strRequestType As String = "POST" _
) As String

strMessage = Replace(Trim(strMessage), " ", "%20")
Me.SMSPost1.From = strFrom
Me.SMSPost1.Message = strMessage
Me.SMSPost1.username = strUserName
Me.SMSPost1.password = strPassword
Me.SMSPost1.sTo = strTo
Me.SMSPost1.sRequestType = strRequestType
Me.SMSPost1.SendSMS
GetSMSServerResponse = SMSPost1.SMSResponse

End Function
'-----------------------------------------------------------------

Private Sub cmdSendSMS_Click()
Dim strSQL As String
Dim rsSource As DAO.Recordset
Dim rsResponse As DAO.Recordset
Dim strResponse As String

strSQL = "SELECT * FROM Customers WHERE BlnCheck=-1"
Set rsSource = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
If rsSource.RecordCount Then
rsSource.MoveFirst
strSQL = "SELECT * FROM tblServerResponses"
Set rsResponse = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
While Not rsSource.EOF
strResponse = GetSMSServerResponse( _
Nz(Me.txtMessage), _
Nz(Me.txtFrom), _
Nz(Me.txtUserName), _
Nz(Me.txtPassword), _
Nz(rsSource!txtTelefon))

rsResponse.AddNew
rsResponse!dtDate = Now
rsResponse!CustomerID = rsSource!CustomerID
rsResponse!txtResponse = strResponse
rsResponse!txtMessage = Nz(Me.txtMessage)
rsResponse.Update

rsSource.MoveNext
Wend

rsSource.Close
Set rsSource = Nothing
rsResponse.Close
Set rsResponse = Nothing
Else
MsgBox "δεν έχετε τσεκάρει κανένα παραλήπτη!", vbInformation
rsSource.Close
Set rsSource = Nothing
End If
End Sub

Ο κώδικας είναι από τον κύριο Τάσο Φιλοξενίδη και τον ευχαριστώ
Απάντηση με παράθεση
Απάντηση στο θέμα


Δικαιώματα - Επιλογές
Δε μπορείτε να δημοσιεύσετε νέα μηνύματα
Δε μπορείτε να δημοσιεύσετε απαντήσεις
Δεν μπορείτε να επισυνάψετε αρχεία
Δεν μπορείτε να επεξεργαστείτε τα μηνύματα σας

Ο κώδικας ΒΒ είναι σε λειτουργία
Τα Smilies είναι σε λειτουργία
Ο κώδικας [IMG] είναι σε λειτουργία
Ο κώδικας HTML είναι εκτός λειτουργίας
Trackbacks are εκτός λειτουργίας
Pingbacks are εκτός λειτουργίας
Refbacks are εκτός λειτουργίας



Η ώρα είναι 03:36.