Re: [sqlite] [ANN] 1st pre-alpha release of the SQLite OLE/DB provider

2004-09-11 Thread Nuno Lucas
Vladimir Vukicevic, dando pulos de alegria, escreveu :
Hi yesso,
On Sat, 11 Sep 2004 09:02:08 +0200, yesso <[EMAIL PROTECTED]> wrote:
hi, can i use this provider in a c# project?
Yes, you can use it with any language that can access ADO and/or OLE-DB 
databases.

But as Vladimir pointed out, you may be better with a more direct driver 
for your specific language.
The advantages of an OLE/DB provider are database engine independence, 
but every case can be better with/without it.

Regards,
~Nuno Lucas
You may want to also look at the SQLite ADO.NET provider at
http://www.mono-project.com/contributing/sqlite.html , which is part
of mono's class libraries, but works fine with the .NET runtime.
- Vlad



Re: [sqlite] [ANN] 1st pre-alpha release of the SQLite OLE/DB provider

2004-09-11 Thread Vladimir Vukicevic
Hi yesso,

On Sat, 11 Sep 2004 09:02:08 +0200, yesso <[EMAIL PROTECTED]> wrote:
> 
> hi, can i use this provider in a c# project?
> 

You may want to also look at the SQLite ADO.NET provider at
http://www.mono-project.com/contributing/sqlite.html , which is part
of mono's class libraries, but works fine with the .NET runtime.

- Vlad


Re: [sqlite] [ANN] 1st pre-alpha release of the SQLite OLE/DB provider

2004-09-11 Thread yesso
Hallo Nuno,

Saturday, September 11, 2004, 5:05:31 AM, du hattest geschrieben:

NL> Hi all.

NL> I just finished a first version of the SQLite OLE/DB provider.
NL> It only implements the basic ADO functionality (execute SQL command and
NL> Recordset view).

NL> I make it available for all (free of charge, with no limitations), so I
NL> can get feedback on the OLE/DB functionality people want most.

NL> You can get it at: http://xpto.ath.cx/sqlite
NL> It includes a sqlite3.dll, so you can change to a more recent sqlite
NL> version without problems.

NL> You need to register it using "regsvr32.exe sqliteoledb.dll"

NL> A basic ADO usage case (in javascript, as I don't know/remember VB), is
NL> attached (and can be found at the directory).

NL> Let me know what it doesn't work in your case, so I know what I need to
NL> implement next (and any bugs, off course ;)

NL> You can contact me at: [EMAIL PROTECTED] or [EMAIL PROTECTED]

NL> Best regards,
NL> ~Nuno Lucas





hi, can i use this provider in a c# project?

-- 
mfG,
 yessomailto:[EMAIL PROTECTED]



Re: [sqlite] [ANN] 1st pre-alpha release of the SQLite OLE/DB provider

2004-09-10 Thread Nuno Lucas
Sorry about all anti-virus that started replying about a dangerous file 
attachment.
I should have thought about it.
You can get a look at the javascript code in this reply.

Regards,
~Nuno Lucas
Nuno Lucas, dando pulos de alegria, escreveu :
Hi all.
I just finished a first version of the SQLite OLE/DB provider.
It only implements the basic ADO functionality (execute SQL command and
Recordset view).
I make it available for all (free of charge, with no limitations), so I
can get feedback on the OLE/DB functionality people want most.
You can get it at: http://xpto.ath.cx/sqlite
It includes a sqlite3.dll, so you can change to a more recent sqlite
version without problems.
You need to register it using "regsvr32.exe sqliteoledb.dll"
A basic ADO usage case (in javascript, as I don't know/remember VB), is
attached (and can be found at the directory).
Let me know what it doesn't work in your case, so I know what I need to
implement next (and any bugs, off course ;)
You can contact me at: [EMAIL PROTECTED] or 
[EMAIL PROTECTED]

Best regards,
~Nuno Lucas



//
// Run this in a command prompt using a line like this:
// c:\> cscript demo.js
//
/
 * Utility functions
 ***/
function JustLeft( str, n )
{
if ( str.length > n )
return str;
for ( left = n - str.length; left >= 0; --left )
str += ' ';
return str;
}
function PrintProps( out, props )
{
for ( n = 0; n < props.Count; ++n )
{
tmp = JustLeft( props(n).Name, 40 );
out.Write( " " + tmp );
out.WriteLine( props(n) );
}
}
function DumpRecordset( out, rs )
{
// Print column names
  out.WriteLine( "===" );
flds = rs.Fields;
for ( i = 0; i < flds.Count; ++i )
{
f = flds.Item(i);
out.Write( JustLeft(f.Name,8) );
}
if ( flds.Count > 0 )
  {
out.WriteLine( );
out.WriteLine( "---" );
  }
else
out.WriteLine( "[No records]" );

while ( !rs.EOF )
{
flds = rs.Fields;
for ( i = 0; i < flds.Count; ++i )
{
f = flds.Item(i);
out.Write( JustLeft(f.Value,8) );
}
out.WriteLine( );
rs.MoveNext( );
}
  out.WriteLine( "===" );
}
/
 * Main Program
 ***/
connString = "Provider=OleDb.SqliteProv; Location='demo.db'";
out = WScript.StdOut;
// Create the ADO conection object and open the database
conn = new ActiveXObject( "ADODB.Connection" );
conn.Open( connString );
// Show Connection properties
out.WriteLine( "ADO.Connection.Properties:" );
PrintProps( out, conn.Properties );
out.writeLine( );
// Do a simple integrey check
out.WriteLine( "PRAGMA integrity_check" );
rs = conn.Execute( "PRAGMA integrity_check" );
DumpRecordset( out, rs );
// Create a table (will fail on second time, off course)
// and insert some rows
conn.Execute( "CREATE TABLE t1 ( x INTEGER PRIMARY KEY, y, z )" );
conn.Execute( "INSERT INTO t1(x,y,z) VALUES(NULL,'a field','1 more field')")
conn.Execute( "INSERT INTO t1(x,y,z) VALUES(NULL,'hello',76342)")
conn.Execute( "INSERT INTO t1(x,y,z) VALUES(NULL,'hello','world!')")
// Show existing tables
out.WriteLine( "SELECT * FROM sqlite_master:" );
rs = conn.Execute( "SELECT * FROM sqlite_master" );
DumpRecordset( out, rs );
// Show rows of the table 't1'
out.WriteLine( "SELECT * FROM t1:" );
rs = conn.Execute( "SELECT * FROM t1" );
DumpRecordset( out, rs );



[sqlite] [ANN] 1st pre-alpha release of the SQLite OLE/DB provider

2004-09-10 Thread Nuno Lucas
Hi all.
I just finished a first version of the SQLite OLE/DB provider.
It only implements the basic ADO functionality (execute SQL command and
Recordset view).
I make it available for all (free of charge, with no limitations), so I
can get feedback on the OLE/DB functionality people want most.
You can get it at: http://xpto.ath.cx/sqlite
It includes a sqlite3.dll, so you can change to a more recent sqlite
version without problems.
You need to register it using "regsvr32.exe sqliteoledb.dll"
A basic ADO usage case (in javascript, as I don't know/remember VB), is
attached (and can be found at the directory).
Let me know what it doesn't work in your case, so I know what I need to
implement next (and any bugs, off course ;)
You can contact me at: [EMAIL PROTECTED] or [EMAIL PROTECTED]
Best regards,
~Nuno Lucas


//
// Run this in a command prompt using a line like this:
// c:\> cscript demo.js
//


/
 * Utility functions
 ***/

function JustLeft( str, n )
{
if ( str.length > n )
return str;
for ( left = n - str.length; left >= 0; --left )
str += ' ';
return str;
}

function PrintProps( out, props )
{
for ( n = 0; n < props.Count; ++n )
{
tmp = JustLeft( props(n).Name, 40 );
out.Write( " " + tmp );
out.WriteLine( props(n) );
}
}

function DumpRecordset( out, rs )
{
// Print column names
  out.WriteLine( "===" );
flds = rs.Fields;
for ( i = 0; i < flds.Count; ++i )
{
f = flds.Item(i);
out.Write( JustLeft(f.Name,8) );
}
if ( flds.Count > 0 )
  {
out.WriteLine( );
out.WriteLine( "---" );
  }
else
out.WriteLine( "[No records]" );

while ( !rs.EOF )
{
flds = rs.Fields;
for ( i = 0; i < flds.Count; ++i )
{
f = flds.Item(i);
out.Write( JustLeft(f.Value,8) );
}
out.WriteLine( );
rs.MoveNext( );
}
  out.WriteLine( "===" );
}


/
 * Main Program
 ***/

connString = "Provider=OleDb.SqliteProv; Location='demo.db'";
out = WScript.StdOut;
// Create the ADO conection object and open the database
conn = new ActiveXObject( "ADODB.Connection" );
conn.Open( connString );

// Show Connection properties
out.WriteLine( "ADO.Connection.Properties:" );
PrintProps( out, conn.Properties );
out.writeLine( );

// Do a simple integrey check
out.WriteLine( "PRAGMA integrity_check" );
rs = conn.Execute( "PRAGMA integrity_check" );
DumpRecordset( out, rs );

// Create a table (will fail on second time, off course)
// and insert some rows
conn.Execute( "CREATE TABLE t1 ( x INTEGER PRIMARY KEY, y, z )" );
conn.Execute( "INSERT INTO t1(x,y,z) VALUES(NULL,'a field','1 more field')")
conn.Execute( "INSERT INTO t1(x,y,z) VALUES(NULL,'hello',76342)")
conn.Execute( "INSERT INTO t1(x,y,z) VALUES(NULL,'hello','world!')")

// Show existing tables
out.WriteLine( "SELECT * FROM sqlite_master:" );
rs = conn.Execute( "SELECT * FROM sqlite_master" );
DumpRecordset( out, rs );

// Show rows of the table 't1'
out.WriteLine( "SELECT * FROM t1:" );
rs = conn.Execute( "SELECT * FROM t1" );
DumpRecordset( out, rs );