sandeep Posted June 18, 2007 Share Posted June 18, 2007 HI I m trying to insert values toa existing database file, with tables created. BUt when i trying to update the values from the autoit script,nothing is happeing. but if try from the command line prompt everything works fine. Can some body help me on this.. #include <SQLite.au3> #include <SQLite.dll.au3> Func SQLITEOPEN() _SQLite_Startup () If @error > 0 Then MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!") Exit - 1 EndIf _SQLite_Open ("C:\Program Files\AutoIt3\Extras\SQLite\Colorproof.db3") ; Open a :memory: database If @error > 0 Then MsgBox(16, "SQLite Error", "Can't Load Database!") Exit - 1 EndIf _SQLite_Exec(-1,"CREATE TABLE Result1 ([TC ID] INTEGER,RESULT VARCHAR(50),REMARKS VARCHAR(50));") _SQLite_Exec(-1,"INSERT INTO Result1 VALUES (1,'Pass','Working');") _SQLite_Exec(-1,".output C:\Program Files\AutoIt3\Extras\SQLite\Hello.txt") _SQLite_Close () _SQLite_Shutdown () EndFunc Link to comment Share on other sites More sharing options...
McGod Posted June 18, 2007 Share Posted June 18, 2007 Post what MsgBox(1, "", _SQLite_ErrMsg ()) says. Put that after _Exec [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
sandeep Posted June 18, 2007 Author Share Posted June 18, 2007 Post whatMsgBox(1, "", _SQLite_ErrMsg ())says.Put that after _ExecHey,I didnt understand what u told..But i tried placing the message box under each _exec ..I dont get anyy error messages.. i m using V.3.2.4.0 Link to comment Share on other sites More sharing options...
piccaso Posted June 18, 2007 Share Posted June 18, 2007 _SQLite_Exec(-1,".output C:\Program Files\AutoIt3\Extras\SQLite\Hello.txt")this just isn't valid.check out the syntax reference:http://www.sqlite.org/lang.html CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
sandeep Posted June 19, 2007 Author Share Posted June 19, 2007 HI I tried ,but still i m not getting things wrking from the script. Is there any issues with 3.2.4 version. Link to comment Share on other sites More sharing options...
ChrisL Posted June 19, 2007 Share Posted June 19, 2007 (edited) As was pointed out before_SQLite_Exec(-1,".output C:\Program Files\AutoIt3\Extras\SQLite\Hello.txt")Isn't valid. Your code does put data in to a database file it is _SQLite_Exec(-1,".output C:\Program Files\AutoIt3\Extras\SQLite\Hello.txt") that is worng run the below code to get the line with errors #include <SQLite.au3> #include <SQLite.dll.au3> SQLITEOPEN();call the function Func SQLITEOPEN() _SQLite_Startup () If @error > 0 Then MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!") Exit - 1 EndIf _SQLite_Open ("C:\Program Files\AutoIt3\Extras\SQLite\Colorproof.db3") If @error > 0 Then MsgBox(16, "SQLite Error", "Can't Load Database!") Exit - 1 EndIf If NOT _SQLite_Exec(-1,"CREATE TABLE Result1 ([TC ID] INTEGER,RESULT VARCHAR(50),REMARKS VARCHAR(50));") = $SQLITE_OK then Msgbox(0,"Sqlite Error","Line 19 " & _SQLite_ErrMsg ()) If NOT _SQLite_Exec(-1,"INSERT INTO Result1 VALUES (1,'Pass','Working');") = $SQLITE_OK then Msgbox(0,"Sqlite Error", "Line 20 " & _SQLite_ErrMsg ()) If NOT _SQLite_Exec(-1,".output C:\Program Files\AutoIt3\Extras\SQLite\Hello.txt") = $SQLITE_OK then Msgbox(0,"Sqlite Error","Line 21 " & _SQLite_ErrMsg ()) _SQLite_Close () _SQLite_Shutdown () EndFunc Edited June 19, 2007 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
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