mrZack 0 Report post Posted January 20, 2009 Assalamualaikum kkwn Putra,Saya mempunyai 1 project untuk buat satu system SMS. Semua functionality bergerak dgn lancar tetapi cuma untuk submit terus masuk HP je tak lepas2 lagi..Saya mengunakan 1 perkhidamatan dari web service company, Macrokiosk.. Ada kekwn putra penah dgr nama ni tak?Project yang sy cuba bgunkan ni adalah masalah, tak dapat nk send terus masuk HP, cume boleh masuk dalam database jer, tak tahu mcm mane nk letak code.. Saya menggunakan COde Charges studio 4. Mgnakan ASP VB script. Berikut adalah code..CODE<%@ CodePage=1252 %><%'Include Common Files @1-52A39AA9%><!-- #INCLUDE VIRTUAL="/intranet/v2/Common.asp"--><!-- #INCLUDE VIRTUAL="/intranet/v2/Cache.asp" --><!-- #INCLUDE VIRTUAL="/intranet/v2/Template.asp" --><!-- #INCLUDE VIRTUAL="/intranet/v2/Sorter.asp" --><!-- #INCLUDE VIRTUAL="/intranet/v2/Navigator.asp" --><!-- #INCLUDE VIRTUAL="/intranet/v2/Services.asp" --><%'End Include Common Files'Initialize Page @1-79113FE5' VariablesDim PathToRoot, ScriptPath, TemplateFilePathDim FileNameDim RedirectDim Tpl, HTMLTemplateDim TemplateFileNameDim ComponentNameDim PathToCurrentPageDim Attributes' EventsDim CCSEventsDim CCSEventResult' ConnectionsDim DBConMCR' Page controlsDim HeaderDim etracker_menuDim crEtc_sendPMsgDim footerDim ChildControlsSession.CodePage = CCSLocales.Locale.CodePageResponse.Charset = CCSLocales.Locale.CharsetResponse.ContentType = CCSContentTypeRedirect = ""TemplateFileName = "smssender.html"Set CCSEvents = CreateObject("Scripting.Dictionary")PathToCurrentPage = "./cr_etracker/"FileName = "smssender.asp"PathToRoot = "../"ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName))TemplateFilePath = ScriptPath'End Initialize Page'Initialize Objects @1-288F29F8BindEvents "Page"CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeInitialize", Nothing)Set DBConMCR = New clsDBConMCRDBConMCR.OpenSet Attributes = New clsAttributesAttributes("pathToRoot") = PathToRoot' ControlsSet Header = New clsHeaderSet Header.Attributes = AttributesHeader.Initialize "Header", ""Set etracker_menu = New clsetracker_menuSet etracker_menu.Attributes = Attributesetracker_menu.Initialize "etracker_menu", ""Set crEtc_sendPMsg = new clsRecordcrEtc_sendPMsgSet footer = New clsfooterSet footer.Attributes = Attributesfooter.Initialize "footer", ""crEtc_sendPMsg.Initialize DBConMCR' Events%><!-- #INCLUDE VIRTUAL="/intranet/v2/cr_etracker/smssender_events.asp" --><%BindEvents EmptyCCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing)'End Initialize Objects'Execute Components @1-5097F624Header.Operationsetracker_menu.OperationscrEtc_sendPMsg.Operationfooter.Operations'End Execute Components'Go to destination page @1-6D35F4FDIf NOT ( Redirect = "" ) Then UnloadPage Response.Redirect RedirectEnd If'End Go to destination page'Initialize HTML Template @1-2E9DB4BCCCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing)Set HTMLTemplate = new clsTemplateSet HTMLTemplate.Cache = TemplatesRepositoryHTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileNameHTMLTemplate.SetVar "@CCS_PathToRoot", PathToRootSet Tpl = HTMLTemplate.Block("main")CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing)'End Initialize HTML Template'Show Page @1-2442EF52Attributes.Show HTMLTemplate, "page:"Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _ Array(Header, etracker_menu, crEtc_sendPMsg, footer))ChildControls.ShowDim MainHTMLHTMLTemplate.Parse "main", FalseMainHTML = HTMLTemplate.GetHTML("main")CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeOutput", Nothing)If CCSEventResult Then Response.Write MainHTML'End Show Page'Unload Page @1-CB210C62UnloadPageSet Tpl = NothingSet HTMLTemplate = Nothing'End Unload Page'UnloadPage Sub @1-623D2D98Sub UnloadPage() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing) If DBConMCR.State = adStateOpen Then _ DBConMCR.Close Set DBConMCR = Nothing Set CCSEvents = Nothing Set Attributes = Nothing Set Header = Nothing Set etracker_menu = Nothing Set crEtc_sendPMsg = Nothing Set footer = NothingEnd Sub'End UnloadPage SubClass clsRecordcrEtc_sendPMsg 'crEtc_sendPMsg Class @6-1A3CDBB5'crEtc_sendPMsg Variables @6-E3ACB438 ' Public variables Public ComponentName Public HTMLFormAction Public PressedButton Public Errors Public FormSubmitted Public EditMode Public Visible Public Recordset Public TemplateBlock Public Attributes Public CCSEvents Private CCSEventResult Public InsertAllowed Public UpdateAllowed Public DeleteAllowed Public ReadAllowed Public DataSource Public Command Public ValidatingControls Public Controls ' Class variables Dim Button_Insert Dim Button_Update Dim Button_Delete Dim Button_Cancel Dim ctct_id Dim groupID Dim code Dim subject Dim text Dim sender dim rs Dim ArgObj dim IncomingMsg dim Phone dim iCounter'End crEtc_sendPMsg Variables'crEtc_sendPMsg Class_Initialize Event @6-A42B0CA2 Private Sub Class_Initialize() Visible = True Set Errors = New clsErrors Set CCSEvents = CreateObject("Scripting.Dictionary") Set Attributes = New clsAttributes Set DataSource = New clscrEtc_sendPMsgDataSource Set Command = New clsCommand InsertAllowed = True UpdateAllowed = True DeleteAllowed = True ReadAllowed = True Dim Method Dim OperationMode OperationMode = Split(CCGetFromGet("ccsForm", Empty), ":") If UBound(OperationMode) > -1 Then FormSubmitted = (OperationMode(0) = "crEtc_sendPMsg") End If If UBound(OperationMode) > 0 Then EditMode = (OperationMode(1) = "Edit") End If ComponentName = "crEtc_sendPMsg" Method = IIf(FormSubmitted, ccsPost, ccsGet) Set Button_Insert = CCCreateButton("Button_Insert", Method) Set Button_Update = CCCreateButton("Button_Update", Method) Set Button_Delete = CCCreateButton("Button_Delete", Method) Set Button_Cancel = CCCreateButton("Button_Cancel", Method) Set ctct_id = CCCreateList(ccsListBox, "ctct_id", CCSLocales.GetText("ctct_id", ""), ccsFloat, CCGetRequestParam("ctct_id", Method), Empty) ctct_id.BoundColumn = "ctct_id" ctct_id.TextColumn = "phone" 'ctct_id.TextColumn = "f_name" Set ctct_id.DataSource = CCCreateDataSource(dsTable,DBConMCR, Array("SELECT * " & _"FROM crEtc_contact {SQL_Where} {SQL_OrderBy}", "", "")) Set groupID = CCCreateList(ccsListBox, "groupID", CCSLocales.GetText("groupID", ""), ccsFloat, CCGetRequestParam("groupID", Method), Empty) groupID.BoundColumn = "groupID" groupID.TextColumn = "group_name" Set groupID.DataSource = CCCreateDataSource(dsTable,DBConMCR, Array("SELECT * " & _"FROM crEtc_group {SQL_Where} {SQL_OrderBy}", "", "")) Set code = CCCreateList(ccsListBox, "code", CCSLocales.GetText("code", ""), ccsText, CCGetRequestParam("code", Method), Empty) code.BoundColumn = "code" code.TextColumn = "country_name" Set code.DataSource = CCCreateDataSource(dsTable,DBConMCR, Array("SELECT * " & _"FROM crEtc_CountryCode {SQL_Where} {SQL_OrderBy}", "", "")) Set subject = CCCreateControl(ccsTextBox, "subject", CCSLocales.GetText("subject", ""), ccsText, Empty, CCGetRequestParam("subject", Method)) Set text = CCCreateControl(ccsTextBox, "text", CCSLocales.GetText("text", ""), ccsText, Empty, CCGetRequestParam("text", Method)) Set sender = CCCreateControl(ccsTextBox, "sender", CCSLocales.GetText("sender", ""), ccsText, Empty, CCGetRequestParam("sender", Method)) Set ValidatingControls = new clsControls ValidatingControls.addControls Array(ctct_id, groupID, code, subject, text, sender) End Sub'End crEtc_sendPMsg Class_Initialize Event'crEtc_sendPMsg Initialize Method @6-F292B84B Sub Initialize(objConnection) If NOT Visible Then Exit Sub Set DataSource.Connection = objConnection With DataSource .Parameters("urlsmsPID") = CCGetRequestParam("smsPID", ccsGET) End With End Sub'End crEtc_sendPMsg Initialize Method'crEtc_sendPMsg Class_Terminate Event @6-0C5D276C Private Sub Class_Terminate() Set Errors = Nothing Set Attributes = Nothing End Sub'End crEtc_sendPMsg Class_Terminate Event'crEtc_sendPMsg Validate Method @6-B9D513CF Function Validate() Dim Validation ValidatingControls.Validate CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me) Validate = ValidatingControls.isValid() And (Errors.Count = 0) End Function'End crEtc_sendPMsg Validate Method'crEtc_sendPMsg Operation Method @6-8B799ECE Sub Operation() If NOT ( Visible AND FormSubmitted ) Then Exit Sub If FormSubmitted Then PressedButton = IIf(EditMode, "Button_Update", "Button_Insert") If Button_Insert.Pressed Then PressedButton = "Button_Insert" 'redirect = "http://www.etracker.cc/mes/mesbulk.aspx?user=mayflower&pass=&type=0&to=60173756025&from=macrokiosk&text=testing+zahir&servid=MAY01" ElseIf Button_Update.Pressed Then PressedButton = "Button_Update" ElseIf Button_Delete.Pressed Then PressedButton = "Button_Delete" ElseIf Button_Cancel.Pressed Then PressedButton = "Button_Cancel" End If End If Redirect = FileName & "?" & CCGetQueryString("QueryString", Array("ccsForm", "Button_Insert.x", "Button_Insert.y", "Button_Insert", "Button_Update.x", "Button_Update.y", "Button_Update", "Button_Delete.x", "Button_Delete.y", "Button_Delete", "Button_Cancel.x", "Button_Cancel.y", "Button_Cancel")) If PressedButton = "Button_Delete" Then If NOT Button_Delete.OnClick OR NOT DeleteRow() Then Redirect = "" End If ElseIf PressedButton = "Button_Cancel" Then If NOT Button_Cancel.OnClick Then Redirect = "" End If ElseIf Validate() Then If PressedButton = "Button_Insert" Then If NOT Button_Insert.OnClick() OR NOT InsertRow() Then redirect = "" ' else'<<<--- testing code----------->'DEL 'select subject, text, sender from crEtc_sendTempMsg where smsID = smsID 'set Conn = server.CreateObject("ADODB.Connection") 'set rs = server.CreateObject("ADODB.Recordset") 'conn.Open 'rs.Open 'Do while not rs.eof 'select ctct_id.phone, text from crEtc_sendPMsg where smsPID = smsPID 'select ctct_id, groupID, subject, text, sender from crEtc_sendTempMsg inner join crEtc_contact.ctct_id where smsID = ctct_id 'ctct_id.value = request("ctct_id") 'groupID.value = request("groupID") 'code.value = request("code") 'subject.value = request("subject") 'text.value = request("text") 'sender.value = request("sender") 'DEL 'loop 'url = address & "?uname=" & uname & "&pword=" & pword & "&message=" & message & "&from=" & from & "&selectednums=" & selectednums & "&info=" & info & "&test=" & test 'redirect = "http://www.etracker.cc/mes/mesbulk.aspx? & user=mayflower&pass=&type=0&"&to=" & ctct_id.phone & from=macrokiosk& "&text=" & text & "&ctct_id=" & ctct_id" ' redirect = "http://www.etracker.cc/mes/mesbulk.aspx? & "?user=" & mayflower & "&pass=" & "&type=" & 0 & "&to=" & ctct_id.phone & "&from=" & macrokiosk & "&text=" & text & "&ctct_id=" & ctct_id" ' rs.Close ' loop 'function testing sms'Function Sms()'else'set ArgObj = wscript.arguments'phone = ArgObj(0)'ctct_id = ArgObj(1)'for iCounter = 2 to ArgObj.count-1'IncomingMsg=IncomingMsg & " "& ArgObj(iCounter)'next'Const adOpenStatic = 3'Const adLockOptimistic = 3'Const adUserClient = 3'Set conSubscriptions = createObject("ADODB.Connection")'Set rstSubscriptions = createObject("ADODB.Recordset")'conSubscriptions.Open "DSN=172.16.0.43;"'rstSubscriptions.CursorLocation = adUseClient'rstSubscriptions.Open "Select phone from crEtc_contact where ctct_id=" & ctct_id, conSubscriptions, adOpenStatic, adLockOptimistic'if rstSubscriptions.RecordCount > 0 then'Set rstSend = createObject("ADODB.Recordset")'rstSend.Open "Select * from crEtc_SendPMsg", conSubscriptions, adOpenStatic, adlockOptimistic'rstSubscriptions.MoveFirst'do until rstSubscriptions.EOF'rstSend.AddNew'rstSend("DESTINATION") = rstSubscriptions.Field("phone")'rstSend("CONTENT") = IncomingMsg'rstSend("OUTCONTENT") = IncomingMsg'rstSend("WhenToSent") = now()'rstSend.Update'rstSubscriptions.MoveNext'loop'redirect = "http://www.etracker.cc/mes/mesbulk.aspx?user=mayflower&pass=&type=0&to=60173756025&from=macrokiosk&text=text + testing&ctct_id=ctct_id" 'else'end if'on error resume next'rstSend.Close'rstSubscriptions.Close'set rstSend=nothing'set rstSubscriptions=nothing'set conSubscriptions=nothing'end fucntion testing End If ElseIf PressedButton = "Button_Update" Then If NOT Button_Update.OnClick() OR NOT UpdateRow() Then Redirect = "" End If End If Else Redirect = "" End If End Sub'End crEtc_sendPMsg Operation Method'crEtc_sendPMsg InsertRow Method @6-44D68399 Function InsertRow() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeInsert", Me) If NOT InsertAllowed Then InsertRow = False : Exit Function DataSource.ctct_id.Value = ctct_id.Value DataSource.groupID.Value = groupID.Value DataSource.code.Value = code.Value DataSource.subject.Value = subject.Value DataSource.text.Value = text.Value DataSource.sender.Value = sender.Value DataSource.Insert(Command) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInsert", Me) If DataSource.Errors.Count > 0 Then Errors.AddErrors(DataSource.Errors) DataSource.Errors.Clear End If InsertRow = (Errors.Count = 0) End Function'End crEtc_sendPMsg InsertRow Method'crEtc_sendPMsg UpdateRow Method @6-089271FA Function UpdateRow() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUpdate", Me) If NOT UpdateAllowed Then UpdateRow = False : Exit Function DataSource.ctct_id.Value = ctct_id.Value DataSource.groupID.Value = groupID.Value DataSource.code.Value = code.Value DataSource.subject.Value = subject.Value DataSource.text.Value = text.Value DataSource.sender.Value = sender.Value DataSource.Update(Command) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterUpdate", Me) If DataSource.Errors.Count > 0 Then Errors.AddErrors(DataSource.Errors) DataSource.Errors.Clear End If UpdateRow = (Errors.Count = 0) End Function'End crEtc_sendPMsg UpdateRow Method'crEtc_sendPMsg DeleteRow Method @6-D5C1DF24 Function DeleteRow() CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeDelete", Me) If NOT DeleteAllowed Then DeleteRow = False : Exit Function DataSource.Delete(Command) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterDelete", Me) If DataSource.Errors.Count > 0 Then Errors.AddErrors(DataSource.Errors) DataSource.Errors.Clear End If DeleteRow = (Errors.Count = 0) End Function'End crEtc_sendPMsg DeleteRow Method'crEtc_sendPMsg Show Method @6-3DF48FB0 Sub Show(Tpl) If NOT Visible Then Exit Sub CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me) Set Recordset = DataSource.Open(Command) EditMode = Recordset.EditMode(ReadAllowed) HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "crEtc_sendPMsg" & IIf(EditMode, ":Edit", "")) Set TemplateBlock = Tpl.Block("Record " & ComponentName) If TemplateBlock is Nothing Then Exit Sub TemplateBlock.Variable("HTMLFormName") = ComponentName TemplateBlock.Variable("HTMLFormEnctype") ="application/x-www-form-urlencoded" If DataSource.Errors.Count > 0 Then Errors.AddErrors(DataSource.Errors) DataSource.Errors.Clear With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString .Parse False End With End If Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _ Array(ctct_id, groupID, code, subject, text, sender, Button_Insert, _ Button_Update, Button_Delete, Button_Cancel)) If EditMode AND ReadAllowed Then If Errors.Count = 0 Then If Recordset.Errors.Count > 0 Then With TemplateBlock.Block("Error") .Variable("Error") = Recordset.Errors.ToString .Parse False End With ElseIf Recordset.CanPopulate() Then If Not FormSubmitted Then ctct_id.Value = Recordset.Fields("ctct_id") groupID.Value = Recordset.Fields("groupID") code.Value = Recordset.Fields("code") subject.Value = Recordset.Fields("subject") text.Value = Recordset.Fields("text") sender.Value = Recordset.Fields("sender") End If Else EditMode = False End If End If End If If Not FormSubmitted Then End If If FormSubmitted Then Errors.AddErrors ctct_id.Errors Errors.AddErrors groupID.Errors Errors.AddErrors code.Errors Errors.AddErrors subject.Errors Errors.AddErrors text.Errors Errors.AddErrors sender.Errors Errors.AddErrors DataSource.Errors With TemplateBlock.Block("Error") .Variable("Error") = Errors.ToString() .Parse False End With End If TemplateBlock.Variable("Action") = IIF(CCSUseAmps, Replace(HTMLFormAction, "&", CCSAmps), HTMLFormAction) Button_Insert.Visible = NOT EditMode AND InsertAllowed Button_Update.Visible = EditMode AND UpdateAllowed Button_Delete.Visible = EditMode AND DeleteAllowed CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me) If Visible Then Attributes.Show TemplateBlock, "crEtc_sendPMsg" & ":" Controls.Show End If End Sub'End crEtc_sendPMsg Show MethodEnd Class 'End crEtc_sendPMsg Class @6-A61BA892Class clscrEtc_sendPMsgDataSource 'crEtc_sendPMsgDataSource Class @6-E5EF8D51'DataSource Variables @6-A2047568 Public Errors, Connection, Parameters, CCSEvents Public Recordset Public SQL, CountSQL, Order, Where, Orders, StaticOrder Public PageSize Public PageCount Public AbsolutePage Public Fields Dim WhereParameters Public AllParamsSet Public CmdExecution Public InsertOmitIfEmpty Public UpdateOmitIfEmpty Private CurrentOperation Private CCSEventResult ' Datasource fields Public ctct_id Public groupID Public code Public subject Public text Public sender'End DataSource Variables'DataSource Class_Initialize Event @6-B75A73F3 Private Sub Class_Initialize() Set CCSEvents = CreateObject("Scripting.Dictionary") Set Fields = New clsFields Set Recordset = New clsDataSource Set Recordset.DataSource = Me Set Errors = New clsErrors Set Connection = Nothing AllParamsSet = True Set ctct_id = CCCreateField("ctct_id", "ctct_id", ccsFloat, Empty, Recordset) Set groupID = CCCreateField("groupID", "groupID", ccsFloat, Empty, Recordset) Set code = CCCreateField("code", "code", ccsText, Empty, Recordset) Set subject = CCCreateField("subject", "subject", ccsText, Empty, Recordset) Set text = CCCreateField("text", "text", ccsText, Empty, Recordset) Set sender = CCCreateField("sender", "sender", ccsText, Empty, Recordset) Fields.AddFields Array(ctct_id, groupID, code, subject, text, sender) Set InsertOmitIfEmpty = CreateObject("Scripting.Dictionary") InsertOmitIfEmpty.Add "ctct_id", True InsertOmitIfEmpty.Add "groupID", True InsertOmitIfEmpty.Add "code", True InsertOmitIfEmpty.Add "subject", True InsertOmitIfEmpty.Add "text", True InsertOmitIfEmpty.Add "sender", True Set UpdateOmitIfEmpty = CreateObject("Scripting.Dictionary") UpdateOmitIfEmpty.Add "ctct_id", True UpdateOmitIfEmpty.Add "groupID", True UpdateOmitIfEmpty.Add "code", True UpdateOmitIfEmpty.Add "subject", True UpdateOmitIfEmpty.Add "text", True UpdateOmitIfEmpty.Add "sender", True Set Parameters = Server.CreateObject("Scripting.Dictionary") Set WhereParameters = Nothing SQL = "SELECT * " & vbLf & _ "FROM crEtc_sendPMsg {SQL_Where} {SQL_OrderBy}" Where = "" Order = "" StaticOrder = "" End Sub'End DataSource Class_Initialize Event'BuildTableWhere Method @6-D772D124 Public Sub BuildTableWhere() Dim WhereParams If Not WhereParameters Is Nothing Then _ Exit Sub Set WhereParameters = new clsSQLParameters With WhereParameters Set .Connection = Connection Set .ParameterSources = Parameters Set .DataSource = Me .AddParameter 1, "urlsmsPID", ccsFloat, Empty, Empty, Empty, False AllParamsSet = .AllParamsSet .Criterion(1) = .Operation(opEqual, False, "[smsPID]", .getParamByID(1)) .AssembledWhere = .Criterion(1) WhereParams = .AssembledWhere If Len(Where) > 0 Then If Len(WhereParams) > 0 Then _ Where = Where & " AND " & WhereParams Else If Len(WhereParams) > 0 Then _ Where = WhereParams End If End With End Sub'End BuildTableWhere Method'Open Method @6-48A2DA7D Function Open(Cmd) Errors.Clear If Connection Is Nothing Then Set Open = New clsEmptyDataSource Exit Function End If Set Cmd.Connection = Connection Cmd.CommandOperation = cmdOpen Cmd.PageSize = PageSize Cmd.ActivePage = AbsolutePage Cmd.CommandType = dsTable CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildSelect", Me) Cmd.SQL = SQL BuildTableWhere Cmd.Where = Where Cmd.OrderBy = Order If(Len(StaticOrder)>0) Then If Len(Order)>0 Then Cmd.OrderBy = ", "+Cmd.OrderBy Cmd.OrderBy = StaticOrder + Cmd.OrderBy End If Cmd.Options("TOP") = True If Not AllParamsSet Then Set Open = New clsEmptyDataSource Exit Function End If CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteSelect", Me) If Errors.Count = 0 And CCSEventResult Then _ Set Recordset = Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteSelect", Me) Set Recordset.FieldsCollection = Fields Set Open = Recordset End Function'End Open Method'DataSource Class_Terminate Event @6-41B4B08D Private Sub Class_Terminate() If Recordset.State = adStateOpen Then _ Recordset.Close Set Recordset = Nothing Set Parameters = Nothing Set Errors = Nothing End Sub'End DataSource Class_Terminate Event'Delete Method @6-1E6DF519 Sub Delete(Cmd) CmdExecution = True CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildDelete", Me) Set Cmd.Connection = Connection Cmd.CommandOperation = cmdExec Cmd.CommandType = dsTable Cmd.CommandParameters = Empty BuildTableWhere If NOT AllParamsSet Then Errors.AddError(CCSLocales.GetText("CCS_CustomOperationError_MissingParameters", Empty)) End If Cmd.SQL = "DELETE FROM [crEtc_sendPMsg]" & IIf(Len(Where) > 0, " WHERE " & Where, "") CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteDelete", Me) If Errors.Count = 0 And CmdExecution Then Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteDelete", Me) End If End Sub'End Delete Method'Update Method @6-A94C8112 Sub Update(Cmd) CmdExecution = True CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildUpdate", Me) Set Cmd.Connection = Connection Cmd.CommandOperation = cmdExec Cmd.CommandType = dsTable Cmd.CommandParameters = Empty BuildTableWhere If NOT AllParamsSet Then Errors.AddError(CCSLocales.GetText("CCS_CustomOperationError_MissingParameters", Empty)) End If Dim IsDef_ctct_id : IsDef_ctct_id = CCIsDefined("ctct_id", "Form") Dim IsDef_groupID : IsDef_groupID = CCIsDefined("groupID", "Form") Dim IsDef_code : IsDef_code = CCIsDefined("code", "Form") Dim IsDef_subject : IsDef_subject = CCIsDefined("subject", "Form") Dim IsDef_text : IsDef_text = CCIsDefined("text", "Form") Dim IsDef_sender : IsDef_sender = CCIsDefined("sender", "Form") If Not UpdateOmitIfEmpty("ctct_id") Or IsDef_ctct_id Then Cmd.AddSQLStrings "ctct_id=" & Connection.ToSQL(ctct_id, ctct_id.DataType), Empty If Not UpdateOmitIfEmpty("groupID") Or IsDef_groupID Then Cmd.AddSQLStrings "[groupID]=" & Connection.ToSQL(groupID, groupID.DataType), Empty If Not UpdateOmitIfEmpty("code") Or IsDef_code Then Cmd.AddSQLStrings "code=" & Connection.ToSQL(code, code.DataType), Empty If Not UpdateOmitIfEmpty("subject") Or IsDef_subject Then Cmd.AddSQLStrings "subject=" & Connection.ToSQL(subject, subject.DataType), Empty If Not UpdateOmitIfEmpty("text") Or IsDef_text Then Cmd.AddSQLStrings "text=" & Connection.ToSQL(text, text.DataType), Empty If Not UpdateOmitIfEmpty("sender") Or IsDef_sender Then Cmd.AddSQLStrings "sender=" & Connection.ToSQL(sender, sender.DataType), Empty CmdExecution = Cmd.PrepareSQL("Update", "[crEtc_sendPMsg]", Where) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteUpdate", Me) If Errors.Count = 0 And CmdExecution Then Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteUpdate", Me) End If End Sub'End Update Method'Insert Method @6-2BD495D7 Sub Insert(Cmd) CmdExecution = True CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildInsert", Me) Set Cmd.Connection = Connection Cmd.CommandOperation = cmdExec Cmd.CommandType = dsTable Cmd.CommandParameters = Empty Dim IsDef_ctct_id : IsDef_ctct_id = CCIsDefined("ctct_id", "Form") Dim IsDef_groupID : IsDef_groupID = CCIsDefined("groupID", "Form") Dim IsDef_code : IsDef_code = CCIsDefined("code", "Form") Dim IsDef_subject : IsDef_subject = CCIsDefined("subject", "Form") Dim IsDef_text : IsDef_text = CCIsDefined("text", "Form") Dim IsDef_sender : IsDef_sender = CCIsDefined("sender", "Form") If Not InsertOmitIfEmpty("ctct_id") Or IsDef_ctct_id Then Cmd.AddSQLStrings "ctct_id", Connection.ToSQL(ctct_id, ctct_id.DataType) If Not InsertOmitIfEmpty("groupID") Or IsDef_groupID Then Cmd.AddSQLStrings "[groupID]", Connection.ToSQL(groupID, groupID.DataType) If Not InsertOmitIfEmpty("code") Or IsDef_code Then Cmd.AddSQLStrings "code", Connection.ToSQL(code, code.DataType) If Not InsertOmitIfEmpty("subject") Or IsDef_subject Then Cmd.AddSQLStrings "subject", Connection.ToSQL(subject, subject.DataType) If Not InsertOmitIfEmpty("text") Or IsDef_text Then Cmd.AddSQLStrings "text", Connection.ToSQL(text, text.DataType) If Not InsertOmitIfEmpty("sender") Or IsDef_sender Then Cmd.AddSQLStrings "sender", Connection.ToSQL(sender, sender.DataType) CmdExecution = Cmd.PrepareSQL("Insert", "[crEtc_sendPMsg]", Empty) CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteInsert", Me) If Errors.Count = 0 And CmdExecution Then Cmd.Exec(Errors) CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteInsert", Me) End If End Sub'End Insert MethodEnd Class 'End crEtc_sendPMsgDataSource Class @6-A61BA892'Include Page Implementation @2-9F80D665%><!-- #INCLUDE VIRTUAL="/intranet/v2/cr_etracker/Header.asp" --><%'End Include Page Implementation'Include Page Implementation @4-31389957%><!-- #INCLUDE VIRTUAL="/intranet/v2/cr_etracker/etracker_menu.asp" --><%'End Include Page Implementation'Include Page Implementation @30-B0AED5FF%><!-- #INCLUDE VIRTUAL="/intranet/v2/cr_etracker/footer.asp" --><%'End Include Page Implementation%>Harap dapat la kekwn kat putra ni membantu,terima kasih Quote Share this post Link to post Share on other sites
mfaiz II 0 Report post Posted January 21, 2009 I cant help u bro...Bukan tahap saya lagi, sorry... Quote Share this post Link to post Share on other sites
ejoe 0 Report post Posted January 21, 2009 kan macrokiosk bg documentaton camna cara nak guna? Quote Share this post Link to post Share on other sites
bazet 0 Report post Posted January 21, 2009 kalau nak guna linux, try http://cakesms.blogspot.com Quote Share this post Link to post Share on other sites
mrZack 0 Report post Posted January 22, 2009 QUOTE(bazet @ Jan 22 2009, 07:20 AM) <{POST_SNAPBACK}>kalau nak guna linux, try http://cakesms.blogspot.comHai mr bazet Sebenarnya saya cume gunakan asp vb script, linux memang system ni tak pernah digunakan.. Sy buat semua form termasuk insert group, add contact, sms personal & templat sms.. Semua tu boleh disimpan di database.. cume skg ni selepas click button insert sy tak tahu nk letakkan code untuk terus send masuk ke HP.. Etracker cume berikan example url: http://www.etrcaker.cc/mes/mesbulk.aspx?us...mp;servid=MES01.Saya confius macam mane nk letakkan url selepas insert function..mr bazet ade cara lain tak? Quote Share this post Link to post Share on other sites
ejoe 0 Report post Posted January 22, 2009 maybe bleh buat redirect lepas masukkan data ke dbase Quote Share this post Link to post Share on other sites
amrich 0 Report post Posted January 22, 2009 aku buat pakai system sms pakai ozeki sms server.. huhu.. mudahcaya la bro.. ketereran mu ku kagumi.. Quote Share this post Link to post Share on other sites
mrZack 0 Report post Posted January 23, 2009 QUOTE(ejoe @ Jan 22 2009, 07:31 PM) <{POST_SNAPBACK}>maybe bleh buat redirect lepas masukkan data ke dbasesaya sudah cuba buat redirect selepas function insert, tetapi masih tidak berjaya, boleh ejoe bagi contoh untuk itu, semua nya sy dah masukkan didalam contoh coding yang sy dh paste.. pelbagai code sy cube tetapi masih tidak berjaya,Harap dapat membantu,Terima kasih Quote Share this post Link to post Share on other sites