Krikov Posted May 12, 2007 Posted May 12, 2007 Hello I ave A Gui With Sum InpotBox And ComboBox What is Wrong With That Case Case $Update $Col1 = GUICtrlRead($Card_Owner); Read From A ComboBox $Col2 = GUICtrlRead($Date_Buy); Read From A Monthly Calander $Col3 = GUICtrlRead($Total_Cost); Number From InputBox $Col4 = GUICtrlRead($Number_Pays);Number Form ComboBox $Col5 = GUICtrlRead($Each_Pay); Number From Input Box $Col6 = GUICtrlRead($Finish_Date);Date $Col7 = GUICtrlRead($What); Text Form InputBox $Col8 = GUICtrlRead($At_The); Text Form InputBox $AllCol ="'"&$Col1&"','"&$Col2&"','"&$Col3&"','"&$Col4&"','"&$Col5&"','"&$Col6&"','"&$Col7&"','"&$Col8 $Sql3 = "Insert Into Credit_TBL Values ("&$AllCol&")" $oRs3 = ObjCreate("ADODB.Recordset") $oRs3.Execute ($Sql3,$oConn,2,2) $ors3.Close MsgBox(0,"","Data Insrted") Thanks Krikov [topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]
Sardith Posted May 12, 2007 Posted May 12, 2007 (edited) Posting more of your code would be great. Also, what line is it getting to befor the script fails/errors? Edited May 12, 2007 by Sardith [font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]
Krikov Posted May 12, 2007 Author Posted May 12, 2007 (edited) This is all the Code. BTW Some if the Word in The Labels is in Hebrew. expandcollapse popup#include<GuiConstants.au3> #include<Array.au3> #include <Date.au3> Dim $oRs1,$oConn,$Splited_date $Form1 = GUICreate("AForm1",633,489,193,115) $Date_Buy = GUICtrlCreateMonthCal("",432,144,191,154) $Label1 = GUICtrlCreateLabel("ת×ר×× ×¨××ש×",496,120,78,20) GUICtrlSetFont(-1,10,800,0,"Arial") $Koteret = GUICtrlCreateLabel("××¢×§× ××צ××ת",192,8,227,50) GUICtrlSetFont(-1,30,800,4,"Arial") $Label2 = GUICtrlCreateLabel("××¢× ××ר××ס",352,144,69,20) GUICtrlSetFont(-1,10,800,0,"Arial") $Label3 = GUICtrlCreateLabel("×¡× ×תש×××",360,184,62,20) GUICtrlSetFont(-1,10,800,0,"Arial") $Total_Cost = GUICtrlCreateInput("",232,184,121,21) $Card_Owner = GUICtrlCreateCombo("",200,144,145,25) $Label4 = GUICtrlCreateLabel("×ספר תש×××××",336,224,89,25) GUICtrlSetFont(-1,10,800,0,"Arial") $Number_Pays = GUICtrlCreateCombo("1",240,224,89,25) $Label5 = GUICtrlCreateLabel("×× ×ª×©×××",360,264,57,20) GUICtrlSetFont(-1,10,800,0,"Arial") $Each_Pay = GUICtrlCreateInput("",232,264,121,21) $Label6 = GUICtrlCreateLabel("ת×ר×× ×¤×¨×¢××",344,304,73,20) GUICtrlSetFont(-1,10,800,0,"Arial") $Finish_Date = GUICtrlCreateInput("",216,304,121,21) $Label7 = GUICtrlCreateLabel("ס××ת ××צ××",352,344,71,20) GUICtrlSetFont(-1,10,800,0,"Arial") $What = GUICtrlCreateInput("",96,344,249,21) $Label8 = GUICtrlCreateLabel("×ק×× ×¨××ש×",352,384,71,20) GUICtrlSetFont(-1,10,800,0,"Arial") $At_The = GUICtrlCreateInput("",224,384,121,21) $Update = GUICtrlCreateButton("×¢×××",536,440,75,25,0) GUISetState(@SW_SHOW) $oConn = ObjCreate("ADODB.Connection") $oRs1 = ObjCreate("ADODB.Recordset") $oRs2 = ObjCreate("ADODB.Recordset") $oConn.Open ("Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\DB\DataBase.mdb") $Sql1 = "Select * From Card_Owner_TBL Where Index = Index" $oRs1.Open ($Sql1,$oConn,2,2) Do GUICtrlSetData($Card_Owner,$oRs1.Fields(1).Value) $oRs1.MoveNext Until $oRs1.EOF $oRs1.Close $Sql2 = "Select * From Number_Pays_TBL Where Index = Index Order By Index" $oRs2.Open ($Sql2,$oConn,2,2) Do GUICtrlSetData($Number_Pays,$oRs2.Fields(1).Value) $oRs2.MoveNext Until $oRs2.EOF $oRs2.Close While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Number_Pays $Date_calc = GUICtrlRead($Date_Buy) $Splited_date = StringSplit($Date_calc,"/") If $Splited_date[3] < 10 Then $Finish_Date_Calc = _DateAdd('M',GUICtrlRead($Number_Pays) -1 ,$Date_calc) GUICtrlSetData($Finish_Date,$Finish_Date_Calc) Else $Finish_Date_Calc = _DateAdd('M',GUICtrlRead($Number_Pays),$Date_calc) GUICtrlSetData($Finish_Date,$Finish_Date_Calc) EndIf Case $Update Dim $AllCol[1] $Col1 = GUICtrlRead($Card_Owner) $Col2 = GUICtrlRead($Date_Buy) $Col3 = GUICtrlRead($Total_Cost) $Col4 = GUICtrlRead($Number_Pays) $Col5 = GUICtrlRead($Each_Pay) $Col6 = GUICtrlRead($Finish_Date) $Col7 = GUICtrlRead($What) $Col8 = GUICtrlRead($At_The) $AllCol ="'"&$Col1&"','"&$Col2&"','"&$Col3&"','"&$Col4&"','"&$Col5&"','"&$Col6&"','"&$Col7&"','"&$Col8 $Sql3 = "Insert Into Credit_TBL Values ("&$AllCol&")" $oRs3 = ObjCreate("ADODB.Recordset") $oRs3.Open ($Sql3,$oConn,2,2) $oRs3.AddNew EndSwitch WEnd KRIKOV Edited May 12, 2007 by Krikov [topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]
ptrex Posted May 12, 2007 Posted May 12, 2007 @Krikovyou might want to try to change the insert syntax to this formatINSERT INTO table_name (column1, column2,...)VALUES (value1, value2,....)This might helpregardsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
Krikov Posted May 12, 2007 Author Posted May 12, 2007 Can Some One Give me an Example Base on Read The Value of A InputBox And Then add Them to the DataBase (MSAccess) Krikov [topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]
Krikov Posted May 12, 2007 Author Posted May 12, 2007 BumpUP [topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now