Jump to content

Recommended Posts

Posted

I am trying to write a program to log data into an SQL database. The program as I have it now is just to test that the process is working, but everytime I run it I get an @error = 2, i.e. SQLite.exe cannot be found. Here is the code as i have it:

#include <SQLite.au3>
#include <SQLite.dll.au3>

Dim $dataBase = FileGetShortName("C:\Documents and Settings\Owner\My Documents\script\TimBot\cardList")
Dim $sqlPath = FileGetShortName("C:\Program Files\AutoIt3\Extras\SQLite")
 
Dim $sOutput

_SQLite_Startup ()

If @error > 0 Then
    MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!")
    Exit - 1
EndIf


_SQLite_Open ($dataBase); Open a :memory: database

If @error > 0 Then
    MsgBox(16, "SQLite Error", "Can't Load Database!")
    Exit - 1
EndIf

Dim $createtbl = "CREATE TABLE cardList(one text, two text, three numeric, four numeric, five numeric, six numeric);" & @CRLF
Dim $sInput = "INSERT INTO " & $dataBase & ".cardList" & " VALUES (Tim, TimsSet, 5, 7, 1, 2);" & @CRLF

_SQLite_SQLiteExe ($dataBase, $createtbl, $sOutput, $sqlPath = "SQLite.exe")
_SQLite_SQLiteExe ($dataBase, $sInput, $sOutput, $sqlPath = "SQLite.exe")



If @error > 0 Then
    MsgBox(16, "Error", @error)
    Exit - 1
EndIf

_SQLite_Close ()
_SQLite_Shutdown ()
Posted

AutoIt\Extras\SQLite

It's called "squlite3.exe"

Hmmm. Still says sglite.exe on mine.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Posted

Hmmm. Still says sglite.exe on mine.

with these changes

#include <SQLite.au3>
#include <SQLite.dll.au3>

_SQLite_Startup ()

If @error > 0 Then
    MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!")
    Exit - 1
EndIf

Dim $dataBase = FileGetShortName("C:\Documents and Settings\Owner\My Documents\script\TimBot\cardList")
_SQLite_Open ( $dataBase= ":memory:"); Open a :memory: database

If @error > 0 Then
    MsgBox(16, "SQLite Error", "Can't Load Database!")
    Exit - 1
EndIf

Dim $sqlPath = FileGetShortName("C:\Program Files\AutoIt3\Extras\SQLite\sqlite3.exe")
Dim $sOutput
Dim $createtbl = "CREATE TABLE cardList(one text, two text, three numeric, four numeric, five numeric, six numeric);" & @CRLF
Dim $sInput = "INSERT INTO " & "cardList" & " VALUES (Tim, TimsSet, 5, 7, 1, 2);" & @CRLF


_SQLite_SQLiteExe ($dataBase, $createtbl, $sOutput, $sqlPath)
_SQLite_SQLiteExe ($dataBase, $sInput, $sOutput, $sqlPath)


If @error > 0 Then
    MsgBox(16, "Error", @error)
    Exit - 1
EndIf

_SQLite_Close ()
_SQLite_Shutdown ()

I am now getting an @error=3. Don't know what is wrong with my SQL, seems pretty simple.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...