About SQLite
SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. Features include:
Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.
Zero-configuration - no setup or administration needed.
Implements most of SQL92
A complete database is stored in a single disk file.
Database files can be freely shared between machines with different byte orders.
Supports terabyte-sized databases and gigabyte-sized strings and blobs.
Small code footprint: less than 250KiB fully configured or less than 150KiB with optional features omitted.
Faster than popular client/server database engines for most common operations.
Simple, easy to use API.
TCL bindings included. Bindings for many other languages available separately.
Well-commented source code with over 98% test coverage.
Available as a single ANSI-C source-code file that you can easily drop into another project.
Self-contained: no external dependencies.
Sources are in the public domain. Use for any purpose.
The SQLite distribution comes with a standalone command-line access program (sqlite) that can be used to administer an SQLite database and which serves as an example of how to use the SQLite library.
SQLite website: http://www.sqlite.org/
The attached file contains my translation of the SQLite headers to PowerBASIC.
The following example demonstrates how to create a database using SQLite.
' ########################################################################################
' Sqlite example
' Creates a dabase.
' ########################################################################################
' SED_PBCC
#COMPILE EXE
#DIM ALL
#INCLUDE "WINDOWS.INC"
#INCLUDE "SQLITE3.INC"
$TEST_DATABASE = "TESTDB.SQLITE"
' ========================================================================================
' Returns an string describing in English the error condition for the most recent
' sqlite3_* API call.
' ========================================================================================
FUNCTION SQL3_ErrMsg (BYVAL hSqlite AS DWORD) AS STRING
LOCAL pErrMsg AS ASCIIZ PTR
IF hSqlite = %NULL THEN EXIT FUNCTION
pErrMsg = sqlite3_errmsg(hSqlite)
FUNCTION = @pErrMsg
END FUNCTION
' ========================================================================================
' ========================================================================================
' Main
' ========================================================================================
FUNCTION PBMAIN () AS LONG
LOCAL hr AS LONG
LOCAL hLite AS DWORD
LOCAL szDbName AS ASCIIZ * %MAX_PATH
LOCAL szSQL AS ASCIIZ * 256
LOCAL pTable AS DWORD PTR
LOCAL cRows AS LONG
LOCAL cCols AS LONG
LOCAL pErrMsg AS ASCIIZ PTR
' Delete the database if already exists
szDbName = $TEST_DATABASE
IF DIR$(szDbName) <> "" THEN
KILL szDbName
END IF
' Create the database
hr = sqlite3_open(szDbName, hLite)
IF hr <> %SQLITE_OK OR hLite = %NULL THEN
PRINT "Error " & STR$(hr) & " creating the database"
IF hLite THEN sqlite3_close(hLite)
EXIT FUNCTION
END IF
' Create a table
szSQL = "CREATE TABLE Table1 (ID INT, Name TEXT, Age TEXT)"
hr = sqlite3_get_table(hLite, szSQL, pTable, cRows, cCols, pErrMsg)
IF hr <> %SQLITE_OK THEN
PRINT @pErrMsg
sqlite3_free(pErrMsg)
GOTO Terminate
END IF
' Discard the result set
if pTable THEN sqlite3_free_table (pTable)
PRINT "Database created"
Terminate:
' Close the database
IF hLite THEN sqlite3_close(hLite)
WAITKEY$
END FUNCTION
' ========================================================================================
SQLite v. 3.7.6.3 Headers
« on: June 01, 2011, 12:31:06 AM »
* SQLite_3_7_6_3.rar (388.97 kB - downloaded 40 times.)
« Last Edit: August 06, 2011, 02:34:10 PM by José Roca »
I got index.php 8)
I can't download SQLite_3_7_6_3.rar :'(
Works fine with FireFox 7.1 and Internet Explorer 9. Which browser and version are you using?
It is a problem with FireFox 8.0. See: http://www.simplemachines.org/community/index.php?topic=458550.msg3203556#msg3203556
Try right-click>"Save link as" to see if it works.
I was aware of the filename issue since a while, about two years ago i had a similar thing, some browsers don't accept the quotes at all.
I forgot which browser then but it may have been FF all along..
The problems appeared with our own download (file) streams assembly (ASP.NET).
I believe the solution was to abandon the quotes, even if a name having spaces is involved.
(For you to find out :) )