Showing posts with label 로컬 데이터베이스. Show all posts
Showing posts with label 로컬 데이터베이스. Show all posts
2010/08/30
SQLite Release 3.7.2.0 (정적/동적 라이브러리 포함)
2010 August 24 (3.7.2)
2010 August 23 (3.7.1)
<
Original Post : http://neodreamer-dev.tistory.com/457
- Fix an old and very obscure bug that can lead to corruption of the database free-page list when incremental_vacuum is used.
2010 August 23 (3.7.1)
- Added new commands SQLITE_DBSTATUS_SCHEMA_USED and SQLITE_DBSTATUS_STMT_USED to the sqlite3_db_status() interface, in order to report out the amount of memory used to hold the schema and prepared statements of a connection.
- Increase the maximum size of a database pages from 32KiB to 64KiB.
- Use the LIKE optimization even if the right-hand side string contains no wildcards.
- Added the SQLITE_FCNTL_CHUNK_SIZE verb to the sqlite3_file_control() interface for both unix and windows, to cause database files to grow in large chunks in order to reduce disk fragmentation.
- Fixed a bug in the query planner that caused performance regresssions relative to 3.6.23.1 on some complex joins.
- Fixed a typo in the OS/2 backend.
- Refactored the pager module.
- The SQLITE_MAX_PAGE_SIZE compile-time option is now silently ignored. The maximum page size is hard-coded at 65536 bytes.
<
Original Post : http://neodreamer-dev.tistory.com/457
Labels:
SQLite
,
SQLite for C++ Builder
,
SQLite for Visual C++
,
SQLite library
,
SQLite Static Library
,
TistoryOldPost
,
데이터베이스
,
로컬 데이터베이스
,
무료 데이터베이스
2010/08/05
SQLite Release 3.7.0.1 (정적/동적 라이브러리 포함)
이번 버전에서 바뀐 사항
- Fix a potential database corruption problem that can result if the same database file is alternately written by version 3.7.0 and 3.6.23.1. See ticket [51ae9cad31] for details.
- Fix a possible performance regression caused by the introduction of automatic indexing.
Labels:
SQLite
,
SQLite for C++ Builder
,
SQLite for Visual C++
,
SQLite library
,
TistoryOldPost
,
로컬 데이터베이스
,
무료 데이터베이스
2010/01/06
SQLite 3.6.22 Released & Library (Static, Dynamic)
3.6.22 ( 2010/01/06 ) 에서 변경된 사항
SQLite homepage
SQLite Library for C++ Builder (DLL 및 정적라이브러리)
SQLite Library for Visual C++ ( DLL 및 정적라이브러리 32/64bit)
<
Original Post : http://neodreamer-dev.tistory.com/355
- Fix bugs that can (rarely) lead to incorrect query results when the CAST or OR operators are used in the WHERE clause of a query.
- Continuing enhancements and improvements to FTS3.
- Other miscellanous bug fixes.
SQLite homepage
SQLite Library for C++ Builder (DLL 및 정적라이브러리)
SQLite Library for Visual C++ ( DLL 및 정적라이브러리 32/64bit)
<
Original Post : http://neodreamer-dev.tistory.com/355
Labels:
Database
,
Free Database
,
Local Database
,
SQLite
,
SQLite 64bit Dll
,
SQLite Dll
,
SQLite for C++ Builder
,
SQLite for Visual C++
,
SQLite library
,
SQLite Static Library
,
TistoryOldPost
,
데이터베이스
,
로컬 데이터베이스
,
무료 데이터베이스
2009/10/15
SQLite 3.6.19 Released
이번 버전에서 수정된 사항
SQLite homepage
SQLite download
Original Post : http://neodreamer-dev.tistory.com/335
- Added support for foreign key constraints. Foreign key constraints are disabled by default. Use the foreign_keys pragma to turn them on.
- Generalized the IS and IS NOT operators to take arbitrary expressions on their right-hand side.
- The TCL Interface has been enhanced to use the Non-Recursive Engine (NRE) interface to the TCL interpreter when linked against TCL 8.6 or later.
- Fix a bug introduced in 3.6.18 that can lead to a segfault when an attempt is made to write on a read-only database.
SQLite homepage
SQLite download
Original Post : http://neodreamer-dev.tistory.com/335
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2009/09/14
SQLite 3.6.18 Released!!
SQLite가 한달 만에 업데이트가 되었다.
사이트 에서는 이전 버전 3.6.12 이전 버전의 사용자는 업그레이드를 추천하고있다.
이번 버전에서 수정된 사항은 아래와 같다.
SQLite Release 3.6.18 On 2009 Sep 11 (3.6.18)
사이트 에서는 이전 버전 3.6.12 이전 버전의 사용자는 업그레이드를 추천하고있다.
이번 버전에서 수정된 사항은 아래와 같다.
SQLite Release 3.6.18 On 2009 Sep 11 (3.6.18)
- Versioning of the SQLite source code has transitioned from CVS to Fossil.
- Query planner enhancements.
- The SQLITE_ENABLE_STAT2 compile-time option causes the ANALYZE command to collect a small histogram of each index, to help SQLite better select among competing range query indices.
- Recursive triggers can be enabled using the PRAGMA recursive_triggers statement.
- Delete triggers fire when rows are removed due to a REPLACE conflict resolution. This feature is only enabled when recursive triggers are enabled.
- Added the SQLITE_OPEN_SHAREDCACHE and SQLITE_OPEN_PRIVATECACHE flags for sqlite3_open_v2() used to override the global shared cache mode settings for individual database connections.
- Added improved version identification features: C-Preprocessor macro SQLITE_SOURCE_ID, C/C++ interface sqlite3_sourceid(), and SQL function sqlite_source_id().
- Obscure bug fix on triggers ([efc02f9779]).
Original Post : http://neodreamer-dev.tistory.com/321
Labels:
Free Database
,
Local Database
,
OpenSource
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
,
무료프로그램
2009/06/29
무료 로컬데이터베이스 SQLite Release 3.6.16
이번 버전에서 바뀐 내용
2009 June 27 (3.6.16)
SQLite Homepage
SQLite Download P
Original Post : http://neodreamer-dev.tistory.com/306
2009 June 27 (3.6.16)
- Fix a bug (ticket #3929) that occasionally causes INSERT
or UPDATE operations to fail on an indexed table that has a
self-modifying trigger. - Other minor bug fixes and performance optimizations.
SQLite Homepage
SQLite Download P
Original Post : http://neodreamer-dev.tistory.com/306
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2009/05/07
SQLite 3.6.14 Released!!
SQLite Release 3.6.14 On 2009 May 7 (3.6.14)
SQLite
SQLite Release Notes
SQLite Download p
Original Post : http://neodreamer-dev.tistory.com/301
- Added the optional asynchronous VFS module.
- Enhanced the query optimizer so that virtual tables are able to make use of OR and IN operators in the WHERE clause.
- Speed improvements in the btree and pager layers.
- Added the SQLITE_HAVE_ISNAN compile-time option which will cause the isnan() function from the standard math library to be used instead of SQLite's own home-brew NaN checker.
- Countless minor bug fixes, documentation improvements, new and improved test cases, and code simplifications and cleanups.
SQLite
SQLite Release Notes
SQLite Download p
Original Post : http://neodreamer-dev.tistory.com/301
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2009/04/14
SQLite 3.6.13 Released!!
3.6.13 버전에서 바뀐 내용
SQLite
SQLite Release Notes
SQLite Download page
Original Post : http://neodreamer-dev.tistory.com/288
- Fix a bug in version 3.6.12 that causes a segfault when running a count(*) on the sqlite_master table of an empty database. Ticket #3774.
- Fix a bug in version 3.6.12 that causes a segfault that when inserting into a table using a DEFAULT value where there is a function as part of the DEFAULT value expression. Ticket #3791.
- Fix data structure alignment issues on Sparc. Ticket #3777.
- Other minor bug fixes.
SQLite
SQLite Release Notes
SQLite Download page
Original Post : http://neodreamer-dev.tistory.com/288
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2009/04/02
SQLite 3.6.12 Released!!
3.6.12 버전에서 바뀐 내용
SQLite
SQLite Download page
Original Post : http://neodreamer-dev.tistory.com/284
- Fixed a bug that caused database corruption when an incremental_vacuum is rolled back in an in-memory database. Ticket #3761.
- Added the sqlite3_unlock_notify() interface.
- Added the reverse_unordered_selects pragma.
- The default page size on windows is automatically adjusted to match the capabilities of the underlying filesystem.
- Add the new ".genfkey" command in the CLI for generating triggers to implement foreign key constraints.
- Performance improvements for "count(*)" queries.
- Reduce the amount of heap memory used, especially by TRIGGERs.
SQLite
SQLite Download page
Original Post : http://neodreamer-dev.tistory.com/284
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2009/03/23
SQLite 64비트에서 테스트...
직접 만든 SQLite 64비트용 정적라이브러리가 정상 동작을 하는지 테스트 해 보았다.
컴파일과 링크에서 경고 메세지가 나오기는 하지만 동작은 하였다.
아래 코드는 테스트에 사용한 코드이다.
이전에 C++Builder 에서 테스트한 코드와 크게 다르지 않다.
테스트에 사용 된 라이브러는 SQLite 3.6.11 버전 소스를 갖고 만든 32비트 용과 64비트용 정적라이브러리를 사용하였다. 두 버전 모두 정상 동작을 하였다
Original Post : http://neodreamer-dev.tistory.com/273
컴파일과 링크에서 경고 메세지가 나오기는 하지만 동작은 하였다.
아래 코드는 테스트에 사용한 코드이다.
이전에 C++Builder 에서 테스트한 코드와 크게 다르지 않다.
void CSQLiteTestView::OnSqliteTest()
{
sqlite3* pSQLite3 = NULL;
sqlite3_stmt* pStmt = NULL;
char* szErrMsg = NULL;
const char* szErr;
CString strMsg;
// Open Database
int rst = sqlite3_open( "test.db", &pSQLite3 );
TRACE( L"Test Start...\n" );
if ( rst )
{
strMsg.Format( L" Can't open database: %s\n",
sqlite3_errmsg16( pSQLite3 ) );
TRACE( strMsg );
}
else
{
TRACE( L" Database (test.db) Opened...\n" );
std::string strQuery;
// 테이블 생성
strQuery = "CREATE TABLE IF NOT EXISTS TestTable ("
" name VARCHAR(20)"
" ,age int"
" ,country VARCHAR(20)"
")";
rst = sqlite3_exec(pSQLite3, strQuery.c_str(), NULL, 0, &szErrMsg);
if ( rst == SQLITE_OK )
{
TRACE( L" Test Table Created... OK\n" );
}
else
{
TRACE( L" Test Table Created... FAILE\n" );
strMsg.Format( L" Error %d : %s",
sqlite3_errcode( pSQLite3 ),
sqlite3_errmsg16( pSQLite3 ) );
TRACE( strMsg );
}
// Inserting...
TRACE( L" Inserting... \n" );
strQuery = "INSERT INTO TestTable ( name, age, country) VALUES ( ?, ?, ? );";
if ( sqlite3_prepare_v2( pSQLite3, strQuery.c_str(),
(int)strQuery.size(), &pStmt, &szErr ) == SQLITE_OK )
{
for ( int i = 0; i < 10; ++i )
{
CStringA str;
std::string strName;
str.Format( "name%d", i );
strName = str;
sqlite3_bind_text( pStmt, 1, strName.c_str(),
(int)strName.size(), NULL );
sqlite3_bind_int( pStmt, 2, i );
std::string strCountry;
sqlite3_bind_text( pStmt, 3, strCountry.c_str(),
(int)strCountry.size(), NULL );
sqlite3_step( pStmt );
INT64 nLast = sqlite3_last_insert_rowid( pSQLite3 );
strMsg.Format( L" Inserted... OK (%d)\n", nLast );
TRACE( strMsg );
sqlite3_reset( pStmt );
}
sqlite3_finalize( pStmt );
}
else
{
TRACE( L" Inserting... FAILE\n" );
strMsg.Format( L" Error %d : %s",
sqlite3_errcode( pSQLite3 ),
sqlite3_errmsg16( pSQLite3 ) );
TRACE( strMsg );
}
TRACE( L" Selecting... \n" );
strQuery = "SELECT COUNT(*) FROM TestTable;";
if ( sqlite3_prepare_v2( pSQLite3, strQuery.c_str(),
(int)strQuery.size(), &pStmt, &szErr ) == SQLITE_OK )
{
int nRow = sqlite3_data_count( pStmt );
int nCol = sqlite3_column_count( pStmt );
const char* col1name = sqlite3_column_name( pStmt, 0 );
int nRowCnt = 0;
while ( sqlite3_step( pStmt ) == SQLITE_ROW )
{
++nRowCnt;
int Count = sqlite3_column_int( pStmt, 0 );
strMsg.Format( L" Row Count ... %d\n", Count );
TRACE( strMsg );
}
}
else
{
TRACE( L" Selecting... FAILE\n" );
strMsg.Format( L" Error %d : %s",
sqlite3_errcode( pSQLite3 ),
sqlite3_errmsg16( pSQLite3 ) );
TRACE( strMsg );
}
// Updating...
TRACE( L" Updating... \n" );
strQuery = "UPDATE TestTable SET country = :country WHERE age < :age;";
if ( sqlite3_prepare_v2( pSQLite3, strQuery.c_str(),
(int)strQuery.size(), &pStmt, &szErr ) == SQLITE_OK )
{
sqlite3_bind_text( pStmt, 1, "KOREA", 5, NULL );
sqlite3_bind_int( pStmt, 2, 5 );
sqlite3_step( pStmt );
int nUpdated = sqlite3_changes( pSQLite3 );
strMsg.Format( L" Updated... %d Rows\n", nUpdated );
TRACE( strMsg );
}
else
{
TRACE( L" Updating... FAILE\n" );
strMsg.Format( L" Error %d : %s",
sqlite3_errcode( pSQLite3 ),
sqlite3_errmsg16( pSQLite3 ) );
TRACE( strMsg );
}
// Deleting...
TRACE( L" Deleting... \n" );
strQuery = "DELETE FROM TestTable WHERE age < :age;";
if ( sqlite3_prepare_v2( pSQLite3, strQuery.c_str(),
(int)strQuery.size(), &pStmt, &szErr ) == SQLITE_OK )
{
sqlite3_bind_int( pStmt, 1, 2 );
sqlite3_step( pStmt );
int nUpdated = sqlite3_changes( pSQLite3 );
strMsg.Format( L" Deleted... %d Rows\n", nUpdated );
TRACE( strMsg );
}
else
{
TRACE( L" Updating... FAILE\n" );
strMsg.Format( L" Error %d : %s",
sqlite3_errcode( pSQLite3 ),
sqlite3_errmsg16( pSQLite3 ) );
TRACE( strMsg );
}
// 테이블 삭제
strQuery = "DROP TABLE IF EXISTS TestTable;";
rst = sqlite3_exec(pSQLite3, strQuery.c_str(), NULL, 0, &szErrMsg);
if ( rst == SQLITE_OK )
{
TRACE( L" Test Table Deleted... OK\n" );
}
else
{
TRACE( L" Test Table Deleted... FAILE\n" );
strMsg.Format( L" Error %d : %s\n",
sqlite3_errcode( pSQLite3 ),
sqlite3_errmsg16( pSQLite3 ) );
TRACE( strMsg );
}
sqlite3_close( pSQLite3 );
TRACE( L" Database (test.db) Closed...\n" );
pSQLite3 = NULL;
}
TRACE( L"Test End...\n" );
}
// 결과
Test Start...
Database (test.db) Opened...
Test Table Created... OK
Inserting...
Inserted... OK (1)
Inserted... OK (2)
Inserted... OK (3)
Inserted... OK (4)
Inserted... OK (5)
Inserted... OK (6)
Inserted... OK (7)
Inserted... OK (8)
Inserted... OK (9)
Inserted... OK (10)
Selecting...
Row Count ... 10
Updating...
Updated... 5 Rows
Deleting...
Deleted... 2 Rows
Test Table Deleted... OK
Database (test.db) Closed...
Test End...
테스트에 사용 된 라이브러는 SQLite 3.6.11 버전 소스를 갖고 만든 32비트 용과 64비트용 정적라이브러리를 사용하였다. 두 버전 모두 정상 동작을 하였다
Original Post : http://neodreamer-dev.tistory.com/273
Labels:
C++
,
SQLite
,
SQLite library
,
TistoryOldPost
,
Visual C++
,
로컬 데이터베이스
2009/02/18
SQLite Release 3.6.11
Changes associated with this release include the following:
* Added the hot-backup interface.
* Added new commands ".backup" and ".restore" to the CLI.
* Added new methods backup and restore to the TCL interface.
* Improvements to the syntax bubble diagrams
* Various minor bug fixes
SQLite 3.6.11
SQLite 3.6.11 Dll
SQLite 3.6.11 Source
SQLite3 v3.6.9 Library for C++ Builder
SQLite3 v3.6.9 Libary for Visual C++
C++ Builder 용 SQLite 정적 라이브러리 만들기
Visual C++ 용 SQLite 정적 라이브러리 만들기
Original Post : http://neodreamer-dev.tistory.com/254
* Added the hot-backup interface.
* Added new commands ".backup" and ".restore" to the CLI.
* Added new methods backup and restore to the TCL interface.
* Improvements to the syntax bubble diagrams
* Various minor bug fixes
SQLite 3.6.11
SQLite 3.6.11 Dll
SQLite 3.6.11 Source
SQLite3 v3.6.9 Library for C++ Builder
SQLite3 v3.6.9 Libary for Visual C++
C++ Builder 용 SQLite 정적 라이브러리 만들기
Visual C++ 용 SQLite 정적 라이브러리 만들기
Original Post : http://neodreamer-dev.tistory.com/254
Labels:
C++
,
C++ Builder
,
Local Database
,
SQLite
,
SQLite for C++ Builder
,
SQLite library
,
TistoryOldPost
,
Turbo C++
,
Visual C++
,
로컬 데이터베이스
2009/01/14
강력한 무료 로컬 데이터베이스 시스템 - SQLite 3.6.9 Released!
무료 로컬 데이터베이스인 SQLite 가 3.6.9 버전을 공개하였다.
이틀만에 버전업을 한 것을 보니 3.6.8 버전에 심각한 문제가 있었나 보다. 제작자도 3.6.8에서 3.6.9로 업데이트를 권장하고 있다.
이번 버전에서 바뀐점은 다음과 같다.
- Fix two bugs, which when combined might result in incorrect query results. Both bugs were harmless by themselves; only when they team up do they cause problems. Ticket #3581.
SQLite 다운로드
Original Post : http://neodreamer-dev.tistory.com/238
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2008/11/28
강력한 무료 로컬 데이터베이스 시스템 - SQLite 3.6.6.2 Released!
얼마전 릴리즈한 3.6.6 버전을 공개한 후로 버그가 발생해서인지 곧바로 3.6.6.1 과 3.6.6.2 버전이 공개가 되었다.
이번 버전에서 수정된 사항은 다음과 같다.
- Fix a bug in the b-tree delete algorithm that seems like it might be
able to cause database corruption. The bug was first introduced in
version 3.6.6 by check-in [5899] on 2008-11-13. - Fix a memory leak that can occur following a disk I/O error.
C++ Builser 와 Visual C++ 용 라이브러리
Original Post : http://neodreamer-dev.tistory.com/205
Labels:
C++
,
C++ Builder
,
Local Database
,
SQLite
,
TistoryOldPost
,
Visual C++
,
로컬 데이터베이스
2008/11/20
강력한 무료 로컬 데이터베이스 시스템 - SQLite 3.6.6 Released!
3.6.6 버전에서 변경된 사항
- Fix a #define that prevented memsys5 from compiling
- Fix a problem in the virtual table commit mechanism that was causing
a crash in FTS3. Ticket #3497. - Add the application-defined page cache
- Added built-in support for VxWorks
SQLite official webpage
SQLite Release note
SQLite Download page
Original Post : http://neodreamer-dev.tistory.com/201
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2008/11/13
강력한 무료 로컬 데이터베이스 시스템 - SQLite 3.6.5 Released!
3.6.5 버전에서 변경된 사항
- Add the MEMORY option to the journal_mode pragma.
- Added the sqlite3_db_mutex() interface.
- Added the SQLITE_OMIT_TRUNCATE_OPTIMIZATION compile-time option.
- Fixed the truncate optimization so that sqlite3_changes() and
sqlite3_total_changes() interfaces and the count_changes pragma
return the correct values. - Added the sqlite3_extended_errcode() interface.
- The COMMIT command now succeeds even if there are pending queries.
It returns SQLITE_BUSY if there are pending incremental BLOB I/O requests. - The error code is changed to SQLITE_BUSY (instead of SQLITE_ERROR)
when an attempt is made to ROLLBACK while one or more queries are
still pending. - Drop all support for the experimental memory allocators memsys4 and
memsys6. - Added the SQLITE_ZERO_MALLOC compile-time option.
SQLite official webpage
SQLite Release note
SQLite Download page
Original Post : http://neodreamer-dev.tistory.com/199
Labels:
DBMS
,
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2008/10/13
MFC 에서 간단하게 DAO 사용하기
MFC 프로그래밍에서 간단하게 DAO를 사용하는 코드이다.
예전에는 자주 사용했지만 현재는 로컬데이터베이스 시스템을 이용할 경우에는 MS-Access 보다는 SQLite를 사용한다.
예전에는 자주 사용했지만 현재는 로컬데이터베이스 시스템을 이용할 경우에는 MS-Access 보다는 SQLite를 사용한다.
// For Database
#include <atlbase.h>
#include <afxoledb.h>
#include <atlplus.h>
#include <afxdao.h> // For MDB
////////////////////////////////////////////////////////////////////////////
// Header
#pragma once
#pragma warning(disable: 4995)
class CLibDB
{
public:
CLibDB(void);
virtual ~CLibDB(void);
private:
LPCTSTR strBOOL(BOOL bFlag);
CString strVARIANT(const COleVariant& var, char *pBuf = NULL);
void DisplayDaoException(CDaoException* e);
BOOL IsExistentTable(CDaoDatabase *pDatabase, CString strTableName);
public:
CDaoDatabase* m_pDB;
CString m_strDBName;
CString m_strModulePath;
enum ERROR_CODE
{
ERROR_NULL_DB = -100,
ERROR_DB_NOT_OPEN = -101,
ERROR_DB_DATA_NOT_FOUNT = -102,
ERROR_DB_DUP_INDEX_FIDLE = -103,
ERROR_MEMORY_EXCEPTION = -1000
};
int InitDB(void);
int CheckDB(void);
bool CreateDB(CString strDBName);
bool CreateTable(CDaoDatabase* pDB);
};
////////////////////////////////////////////////////////////////////////////
// Source
#include "StdAfx.h"
#include "libdb.h"
CLibDB::CLibDB(void)
{
m_pDB = NULL;
// Get Module Path
m_strModulePath = _T("");
char sfilename[255];
GetModuleFileName(NULL, sfilename, sizeof(sfilename));
char Drive[255];
char Path[255];
char Filename[255];
char Ext[255];
_splitpath(sfilename, Drive, Path, Filename, Ext);
m_strModulePath.Format(_T("%s%s"), Drive, Path);
m_strDBName = m_strModulePath + _T("\MyMDB.mdb");
}
CLibDB::~CLibDB(void)
{
if(m_pDB)
{
if(m_pDB->IsOpen())
m_pDB->Close();
delete m_pDB;
}
}
LPCTSTR CLibDB::strBOOL(BOOL bFlag)
{
return bFlag ? _T("TRUE") : _T("FALSE");
}
CString CLibDB::strVARIANT(const COleVariant& var, char *pBuf /*= NULL*/)
{
CString strRet;
strRet = _T("UNKNOWN");
switch(var.vt){
case VT_EMPTY:
case VT_NULL:
strRet = _T("NULL");
break;
case VT_I2:
strRet.Format(_T("%hd"),V_I2(&var));
break;
case VT_I4:
strRet.Format(_T("%d"),V_I4(&var));
break;
case VT_R4:
strRet.Format(_T("%f"),(double)V_R4(&var));
break;
case VT_R8:
strRet.Format(_T("%f"),V_R8(&var));
break;
case VT_CY:
strRet = COleCurrency(var).Format();
break;
case VT_DATE:
strRet = COleDateTime(var).Format(_T("%m %d %y"));
break;
case VT_BSTR:
strRet = V_BSTRT(&var);
break;
case VT_DISPATCH:
strRet = _T("VT_DISPATCH");
break;
case VT_ERROR:
strRet = _T("VT_ERROR");
break;
case VT_BOOL:
return strBOOL(V_BOOL(&var));
case VT_VARIANT:
strRet = _T("VT_VARIANT");
break;
case VT_UNKNOWN:
strRet = _T("VT_UNKNOWN");
break;
case VT_I1:
strRet = _T("VT_I1");
break;
case VT_UI1:
strRet.Format(_T("0x%02hX"),(unsigned short)V_UI1(&var));
break;
case VT_UI2:
strRet = _T("VT_UI2");
break;
case VT_UI4:
strRet = _T("VT_UI4");
break;
case VT_I8:
strRet = _T("VT_I8");
break;
case VT_UI8:
strRet = _T("VT_UI8");
break;
case VT_INT:
strRet = _T("VT_INT");
break;
case VT_UINT:
strRet = _T("VT_UINT");
break;
case VT_VOID:
strRet = _T("VT_VOID");
break;
case VT_HRESULT:
strRet = _T("VT_HRESULT");
break;
case VT_PTR:
strRet = _T("VT_PTR");
break;
case VT_SAFEARRAY:
strRet = _T("VT_SAFEARRAY");
break;
case VT_CARRAY:
strRet = _T("VT_CARRAY");
break;
case VT_USERDEFINED:
strRet = _T("VT_USERDEFINED");
break;
case VT_LPSTR:
strRet = _T("VT_LPSTR");
break;
case VT_LPWSTR:
strRet = _T("VT_LPWSTR");
break;
case VT_FILETIME:
strRet = _T("VT_FILETIME");
break;
case VT_BLOB:
strRet = _T("VT_BLOB");
break;
case VT_STREAM:
strRet = _T("VT_STREAM");
break;
case VT_STORAGE:
strRet = _T("VT_STORAGE");
break;
case VT_STREAMED_OBJECT:
strRet = _T("VT_STREAMED_OBJECT");
break;
case VT_STORED_OBJECT:
strRet = _T("VT_STORED_OBJECT");
break;
case VT_BLOB_OBJECT:
strRet = _T("VT_BLOB_OBJECT");
break;
case VT_CF:
strRet = _T("VT_CF");
break;
case VT_CLSID:
strRet = _T("VT_CLSID");
break;
}
WORD vt = var.vt;
if(vt & VT_ARRAY){
#pragma warning(disable : 4244)
vt = vt & ~VT_ARRAY;
#pragma warning(default : 4244)
strRet = _T("Array of ");
}
if(vt & VT_BYREF){
#pragma warning(disable : 4244)
vt = vt & ~VT_BYREF;
#pragma warning(default : 4244)
strRet += _T("Pointer to ");
}
if(vt != var.vt){
switch(vt){
case VT_EMPTY:
strRet += _T("VT_EMPTY");
break;
case VT_NULL:
strRet += _T("VT_NULL");
break;
case VT_I2:
strRet += _T("VT_I2");
break;
case VT_I4:
strRet += _T("VT_I4");
break;
case VT_R4:
strRet += _T("VT_R4");
break;
case VT_R8:
strRet += _T("VT_R8");
break;
case VT_CY:
strRet += _T("VT_CY");
break;
case VT_DATE:
strRet += _T("VT_DATE");
break;
case VT_BSTR:
strRet += _T("VT_BSTR");
break;
case VT_DISPATCH:
strRet += _T("VT_DISPATCH");
break;
case VT_ERROR:
strRet += _T("VT_ERROR");
break;
case VT_BOOL:
strRet += _T("VT_BOOL");
break;
case VT_VARIANT:
strRet += _T("VT_VARIANT");
break;
case VT_UNKNOWN:
strRet += _T("VT_UNKNOWN");
break;
case VT_I1:
strRet += _T("VT_I1");
break;
case VT_UI1:
strRet += _T("VT_UI1");
break;
case VT_UI2:
strRet += _T("VT_UI2");
break;
case VT_UI4:
strRet += _T("VT_UI4");
break;
case VT_I8:
strRet += _T("VT_I8");
break;
case VT_UI8:
strRet += _T("VT_UI8");
break;
case VT_INT:
strRet += _T("VT_INT");
break;
case VT_UINT:
strRet += _T("VT_UINT");
break;
case VT_VOID:
strRet += _T("VT_VOID");
break;
case VT_HRESULT:
strRet += _T("VT_HRESULT");
break;
case VT_PTR:
strRet += _T("VT_PTR");
break;
case VT_SAFEARRAY:
strRet += _T("VT_SAFEARRAY");
break;
case VT_CARRAY:
strRet += _T("VT_CARRAY");
break;
case VT_USERDEFINED:
strRet += _T("VT_USERDEFINED");
break;
case VT_LPSTR:
strRet += _T("VT_LPSTR");
break;
case VT_LPWSTR:
strRet += _T("VT_LPWSTR");
break;
case VT_FILETIME:
strRet += _T("VT_FILETIME");
break;
case VT_BLOB:
strRet += _T("VT_BLOB");
break;
case VT_STREAM:
strRet += _T("VT_STREAM");
break;
case VT_STORAGE:
strRet += _T("VT_STORAGE");
break;
case VT_STREAMED_OBJECT:
strRet += _T("VT_STREAMED_OBJECT");
break;
case VT_STORED_OBJECT:
strRet += _T("VT_STORED_OBJECT");
break;
case VT_BLOB_OBJECT:
strRet += _T("VT_BLOB_OBJECT");
break;
case VT_CF:
strRet += _T("VT_CF");
break;
case VT_CLSID:
strRet += _T("VT_CLSID");
break;
}
}
if (pBuf != NULL)
{
int nChar = strRet.GetLength();
#ifdef _UNICODE
WideCharToMultiByte( CP_ACP, 0, strRet, -1,
pBuf, nChar, NULL, NULL );
#else
strcpy(pBuf, (LPCSTR)(LPCTSTR)strRet);
#endif
pBuf[nChar] = '\0';
}
return strRet;
}
void CLibDB::DisplayDaoException(CDaoException* e)
{
CString strMsg;
if (e->m_pErrorInfo != NULL)
{
strMsg.Format(
_T("%s (%d)"),
(LPCTSTR)e->m_pErrorInfo->m_strDescription,
e->m_pErrorInfo->m_lErrorCode);
AfxMessageBox(strMsg);
}
else
{
strMsg.Format(
_T("ERROR:CDaoException\n\n")
_T("SCODE_CODE =%d\n")
_T("SCODE_FACILITY =%d\n")
_T("SCODE_SEVERITY =%d\n")
_T("ResultFromScode =%d\n"),
SCODE_CODE (e->m_scode),
SCODE_FACILITY (e->m_scode),
SCODE_SEVERITY (e->m_scode),
ResultFromScode (e->m_scode));
AfxMessageBox(strMsg);
}
}
BOOL CLibDB::IsExistentTable(CDaoDatabase *pDatabase, CString strTableName)
{
CDaoDatabase *pDB = NULL;
BOOL bDuplicateTableName = TRUE;
if (pDatabase == NULL)
pDB = m_pDB;
else
pDB = pDatabase;
if (pDB == NULL)
return FALSE;
CDaoTableDefInfo tableInfo; // only needed for the call
TRY
{
pDatabase->GetTableDefInfo(strTableName, tableInfo);
}
CATCH (CDaoException, e)
{
if (e->m_pErrorInfo->m_lErrorCode == 3265)
bDuplicateTableName = FALSE;
}
AND_CATCH (CMemoryException, e)
{
// do nothing
;
}
END_CATCH
return bDuplicateTableName;
}
int CLibDB::InitDB()
{
if (m_pDB)
{
if (m_pDB->IsOpen())
m_pDB->Close();
delete m_pDB;
m_pDB = NULL;
}
m_pDB = new CDaoDatabase;
CheckDB();
return 0;
}
int CLibDB::CheckDB(void)
{
CFileStatus fileStatus;
if (CFile::GetStatus( m_strDBName, fileStatus ))
{
CDaoDatabase* pDB = new CDaoDatabase;
CString strQuery;
pDB->Open(m_strDBName);
if (pDB->IsOpen())
{
if (IsExistentTable(pDB, "MYGROUP") == FALSE ||
IsExistentTable(pDB, "MEMBER") == FALSE)
{
AfxMessageBox("Database damaged. Recreate database");
CreateTable(pDB);
}
}
if(pDB)
{
if(pDB->IsOpen())
pDB->Close();
delete pDB;
}
// Find DB File
}
else
{
// DB File Not Found
AfxMessageBox("DB Not Found!!\n\nCreate database.");
CreateDB(m_strDBName);
}
return 0;
}
bool CLibDB::CreateDB(CString strDBName)
{
CDaoDatabase* pDB = new CDaoDatabase;
pDB->Create(strDBName);
if(!pDB)
{
TRACE("Fail to Create Database");
return false;
}
else
{
CreateTable(pDB);
if(pDB->IsOpen())
pDB->Close();
delete pDB;
}
return true;
}
bool CLibDB::CreateTable(CDaoDatabase* pDB)
{
if (!pDB)
return false;
if (!pDB->IsOpen())
return false;
CString strQuery;
TRY {
// Create Comopnent Table
strQuery.Format(
"CREATE TABLE MYGROUP ("
" GROUPID INTEGER PRIMARY KEY"
", ALIAS VARCHAR(50)"
", MEMBERS INTEGER"
")"
);
pDB->Execute(strQuery);
}
CATCH (CDaoException, e)
{
DisplayDaoException(e);
}
END_CATCH
TRY {
// Create Address
CDaoTableDef Table(pDB);
CDaoFieldInfo Field;
Table.Create("MEMBER");
Field.m_strName = "NAME";
Field.m_nType = dbText;
Field.m_lSize = 50;
Field.m_lAttributes = dbVariableField;
Field.m_bRequired = TRUE;
Field.m_bAllowZeroLength = FALSE;
Field.m_lCollatingOrder = dbSortGeneral;
Table.CreateField(Field);
Table.CreateField("GROUPID", dbInteger, 4);
Table.CreateField("NAME", dbText, 80);
Table.CreateField("AGE", dbInteger, 4);
Table.CreateField("HEIGHT", dbSingle, 4);
Table.CreateField("WEIGHT", dbSingle, 4);
Field.m_nType = dbBoolean;
Field.m_lSize = 1;
Field.m_lAttributes = dbFixedField | dbUpdatableField;
Field.m_bRequired = TRUE;
Field.m_bAllowZeroLength = FALSE;
Field.m_strDefaultValue = "1";
Field.m_strName = "Gender";
Table.CreateField(Field);
Field.m_strName = "IsAdult";
Table.CreateField(Field);
Table.Append();
}
CATCH (CDaoException, e)
{
DisplayDaoException(e);
}
END_CATCH
return true;
}
Original Post : http://neodreamer-dev.tistory.com/184
Labels:
C++
,
DAO
,
Local Database
,
MDB
,
MFC
,
MS Access
,
TistoryOldPost
,
로컬 데이터베이스
2008/08/07
SQLite Release 3.6.1
강력한 로컬 데이터베이스 시스템인 SQLite 가 버전 업데이트를 했다.
2008 Aug 6 (3.6.1)
* Added the lookaside memory allocator for a speed improvement in excess of 15% on some workloads. (Your mileage may vary.)
* Added the SQLITE_CONFIG_LOOKASIDE verb to sqlite3_config() to control the default lookaside configuration.
* Added verbs SQLITE_STATUS_PAGECACHE_SIZE and SQLITE_STATUS_SCRATCH_SIZE to the sqlite3_status() interface.
* Modified SQLITE_CONFIG_PAGECACHE and SQLITE_CONFIG_SCRATCH to remove the "+4" magic number in the buffer size computation.
* Added the sqlite3_db_config() and sqlite3_db_status() interfaces for controlling and monitoring the lookaside allocator separately on each database connection.
* Numerious other performance enhancements
* Miscellaneous minor bug fixes
2008/07/23 - [Dev Story] - Access를 대체할 강력한 로컬 데이터베이스 엔진 sqlite 3
SQLite Webpage
Original Post : http://neodreamer-dev.tistory.com/138
2008 Aug 6 (3.6.1)
* Added the lookaside memory allocator for a speed improvement in excess of 15% on some workloads. (Your mileage may vary.)
* Added the SQLITE_CONFIG_LOOKASIDE verb to sqlite3_config() to control the default lookaside configuration.
* Added verbs SQLITE_STATUS_PAGECACHE_SIZE and SQLITE_STATUS_SCRATCH_SIZE to the sqlite3_status() interface.
* Modified SQLITE_CONFIG_PAGECACHE and SQLITE_CONFIG_SCRATCH to remove the "+4" magic number in the buffer size computation.
* Added the sqlite3_db_config() and sqlite3_db_status() interfaces for controlling and monitoring the lookaside allocator separately on each database connection.
* Numerious other performance enhancements
* Miscellaneous minor bug fixes
2008/07/23 - [Dev Story] - Access를 대체할 강력한 로컬 데이터베이스 엔진 sqlite 3
SQLite Webpage
Original Post : http://neodreamer-dev.tistory.com/138
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
로컬 데이터베이스
2008/07/23
Access를 대체할 강력한 로컬 데이터베이스 엔진 sqlite 3
Access 데이터베이스를 대체할 만한 데이터베이스 엔진을 찾다가 발견한 녀석이다.
Access 처럼 네트웍을 지원하지는 않지만 단일 실행로 실행이 되며 데이터베이스 파일도 단일 파일로 관리가 되어 이동성에도 좋다.
그 외에도 Transactions, SQL92, Cross-platform 그리고 간단하고 쉬운 API도 제공한다.
단일 실행파일에 의한 데이터베이스 사용
기본으로 제공하는 데이터베이스 엔진은 500KB 정도의 단일 실행파일로 커맨드라인 인터페이스만을 제공하지만 무료로 사용할 수 있는 GUI 툴도 있다.
SQLite GUI for Windows
SQLiteSpy 를 이용하여 test.db에 접속한 화면
SQLite3 website
SQLiteSpy website
Original Post : http://neodreamer-dev.tistory.com/127
Labels:
Local Database
,
SQLite
,
TistoryOldPost
,
데이터베이스
,
로컬 데이터베이스
Subscribe to:
Posts
(
Atom
)