Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Программы » AutoIT (Часть 2)

Модерирует : gyra, Maz

Widok (01-06-2010 13:08): Лимит страниц. Продолжаем здесь.  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

MoBiRo

Junior Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

Код:
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <Array.au3>
 
Local $aResult, $iRows, $iColumns, $iRval
 
_SQLite_Startup ()
If @error Then
    MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!")
    Exit - 1
EndIf
ConsoleWrite("_SQLite_LibVersion=" &_SQLite_LibVersion() & @CRLF)
$dbn= _SQLite_Open ("info.db") ; Open a :memory: database
If @error Then
    MsgBox(16, "SQLite Error", "Can't Load Database!")
    Exit - 1
EndIf
 
If Not
_SQLite_Exec ($dbn, "CREATE TEMP TABLE persons (Name, Age);") = $SQLITE_OK Then _
        MsgBox(16, "SQLite Error", _SQLite_ErrMsg ())
If Not _SQLite_Exec ($dbn, "INSERT INTO persons VALUES ('Alice','43');") = $SQLITE_OK Then _
        MsgBox(16, "SQLite Error", _SQLite_ErrMsg ())
If Not _SQLite_Exec ($dbn, "INSERT INTO persons VALUES ('Bob','28');") = $SQLITE_OK Then _
        MsgBox(16, "SQLite Error", _SQLite_ErrMsg ())
If Not _SQLite_Exec ($dbn, "INSERT INTO persons VALUES ('Cindy','21');") = $SQLITE_OK Then _
        MsgBox(16, "SQLite Error", _SQLite_ErrMsg ())
 
; Query
$iRval = _SQLite_GetTable ($dbn, "SELECT * FROM persons;", $aResult, $iRows, $iColumns)
If $iRval = $SQLITE_OK Then
;~  $aResult Looks Like this:
;~      [0]    = 8
;~      [1]    = Name
;~      [2]    = Age
;~      [3]    = Alice
;~      [4]    = 43
;~      [5]    = Bob
;~      [6]    = 28
;~      [7]    = Cindy
;~      [8]    = 21

    _ArrayDisplay($aResult, "Query Result")
Else
    MsgBox(16, "SQLite Error: " & $iRval, _SQLite_ErrMsg ())
EndIf
 
_SQLite_Close ()
_SQLite_Shutdown ()

Всего записей: 68 | Зарегистр. 11-11-2009 | Отправлено: 21:51 20-02-2010 | Исправлено: MoBiRo, 21:56 20-02-2010
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Программы » AutoIT (Часть 2)
Widok (01-06-2010 13:08): Лимит страниц. Продолжаем здесь.


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru