Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 12:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: SQLite DB
PostPosted: April 14th, 2007, 1:43 pm 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
Has anyone been able to use SQLite Database with Opus, http://www.sqlite.org/

I am currently embarking on a project which will need to use SQLite and I am interested if anyone else has had success with it.


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2007, 1:37 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
More questions
Been to the SQLite site, can't see how I would connect to the database in a windows environment, any ideas
Also anyone who has implemented a MySQL/Posgress(sp) database, please chip in on this...


Top
 Profile  
 
 Post subject:
PostPosted: April 16th, 2007, 3:00 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Haven't done this in a while, but seem to remember that for mySQL, download the ODBC driver and then create a connection as per access. Pages on the web suggest that the principle is the same for SQLite. Get the driver here:

http://www.ch-werner.de/sqliteodbc/sqliteodbc.exe

Mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: April 16th, 2007, 4:51 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Thanks mackavi.


Top
 Profile  
 
 Post subject:
PostPosted: November 25th, 2007, 10:02 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
Anyone managed to use SQLite working using the new external DLL OpusScript functions ? -- I am trying to avoid using ODBC drivers.

cheers
Paul


Top
 Profile  
 
 Post subject:
PostPosted: February 14th, 2008, 11:23 am 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
Any success with SQLite?

Currently need to develop an application with a database on a server, not on local system. I have been researching and Access looks like it is not the best solution for having shared database.

Has someone else tried something similar to this, what technology have you used. I am still looking into SQLite but will ODBC work if Database is not local and on a shared computer.

If someone has experience with this I would appreciate some feedback.


Top
 Profile  
 
 Post subject:
PostPosted: February 14th, 2008, 2:15 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Joe,

Stay away form Access on a server / network - full stop! I used to manage a server DB for a living - and Oracle system with 1000's of end users. You need something like that. Never tried SQLite, but have had mySQL running on a small business network without issues.

The ODBC driver should connect from a client to the server DB without any issue - I've done it for both Oracle / mySQL and connected a range of applications including Opus ones.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 14th, 2008, 9:03 pm 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
Thanks for the reply Mack,

How portable is a mySQL system? Would each have to be setup manually or would it be possible to automate the system. I only know Access and how easy it is to connect via ODBC. Would it be possible just to do it once and then thats it?

I understand that the mySQL database would have to be created with all the content on each server and I assume so automated system could be used for this.

I have a friend who does web and mysql databases so I am going to pick his brain over the weekend about it.

Just a bit confusing need to get my head around it all.


Top
 Profile  
 
 Post subject:
PostPosted: February 14th, 2008, 9:28 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Joe,

Never done this but once setup you can backup the entire database and move to another server so this should be OK. Also there are loads of free mySQL tools including ones that convert access to mySQL.

As for the ODBC driver, you'd need to install just the driver on each client. Depending on the network depends on how it's rolled out and how automatically. I have run a network that creates packages that are distrobuted on next boot that would do this. Also I think the Advanced Installer will create and MSI with ODBC settings so you could use this to create a package.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: February 14th, 2008, 9:41 pm 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
Excellent Mack,

You have got me thinking now and have pointed me in the correct direction to start googling for some solutions.

Currently looking for a solution for training which could be rolled out over 100s and possible 1000 of users at different sites so that's why I am trying to find a better solution than Access. Since there could be so many users at different sites designing a one-stop solution which is as plug and play as possible is ideal.

While Access works great on a local system, it just doesn't work for multiple users and when put on a server.

Thanks again for your help, you should write a book on Opus, I know I would purchase it.


Top
 Profile  
 
 Post subject:
PostPosted: February 28th, 2008, 1:48 pm 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
As I currently use a Access database I think the logical step here would be to try MS SQL instead of MySQL, this appears a little easier as Microsoft include an Upsizing Wizard with Access software.

Just need to nail the ODBC side, so will be doing some testing and will report back. If Digital Workshop have tried something similar or someone else on the form has any guidance it would be very helpful.


Top
 Profile  
 
 Post subject:
PostPosted: April 5th, 2008, 6:06 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Joseph,

You didn't say 'how far' you got with SQLite DB?

I am making some progress. I can connect to the database, but get Opus errors on some basic commands like GetNumberOfRecords() and FirstRecord() after the ExecuteSQL(). Error is '...function not found. Check spelli...'.

I am using the Werner ODBC driver Mackavi pointed to. Before that, I think I got connected to the dhSQLite DB with the standard DSN for Paradox (??). I've researched a bit on the web, seems there are COM wrappers for free or cheap that will allow distributing embedded sqlite DBs and not need ODBC. (need help understanding this). datenhaus http://www.thecommon.net is one, there are others.

I have not used this but it is interesting, No? https://addons.mozilla.org/en-US/firefox/addon/5817 Manage any SQLite database on your computer. An intuitive heirarchical tree....
Got export in mind?... http://andreabertini.wordpress.com/2007 ... so-access/

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Some success reading SQLite (ODBC connection)
PostPosted: April 7th, 2008, 1:30 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Joseph,

I now have Opus page reading in records from SQLite. I did not try inserting or changing. Anyone else want to 'show the way' there?
The while loop in the code is just my way of seeing the records.
Using ODBC ( specifically sqliteodbc ) noted earlier.
The SQLite package is dhsqlite noted earlier.

Using OpusScript:
Code:
// Testing Opus v6 access to an SQLite DB.
function doingnwindDB3()
{
var adiffDB = "D:\\FolderA\\FolderB\\Dwld…   \\dhSQLite-Demo\\NWind.db" ;    //>  your Path here
var finddb = FileExists( " D:\\FolderA\\FolderB\\Dwld…   \\dhSQLite-Demo\\NWind.db ")  ;
testnwdb = finddb  ;  // returns "1"  if true, does exist
//
var SQLi1DB = new Database("DSN=SQLite3 ADatasource;")  ;  //> DSN EQ whateverYOUnameit.
var numreks = null ;       //> optional (as are many of the testvar statements)
var Recors_Prods1 = SQLi1DB.ExecuteSQL("SELECT ProductID,ProductName,SupplierID, ReorderLevel FROM 'Products' WHERE ProductID>12;" ) ;
//
   while ( Recors_Prods1.ProductID <55) {
     testRecP = Recors_Prods1.ProductID ;
     testRecP2 = Recors_Prods1.ProductName;
     testRecP3 = "Product values test:  " + Recors_Prods1.ProductName;
     wait(2)
     Recors_Prods1.NextRecord()
   }
var dbConn = SQLi1DB.Connect() ;
testconnect = dbConn + "  and   "+ testRecP ;    //> will display ‘true    and     true’    if succeed connection (displays after while loop)
//
}   //end:  function doingnwindDB3()
//
//  Note 1:  The DSN expression does not seem critical (how it is written), but does need proper setup
//           through Control Panel >>> Admin...Tools >>> ...ODBC
//  Note 2:  Variables here with 'test...' name are non-persistent Page Vars
//                 testnwdb      testRecP      testRecP2     testRecP3      testconnect
//  Note 3:  I have 'trial & errored' many settings.
//           I think Opus Publ Properties >>> Database tab:  Removing extraneous 'Data Sources'
//           and clearing 'Users' and 'passwords' may have helped.
//  Note 4:  I used the FireFox plugin, SQLite Manager, to view the nwind.db sample database and
//           get the table/column names right. Also, generated the SQL query there, saw the results...
//           Copied the SQL statement
//           Closed that plugin (closing the connection to the DB)
//           Pasted the SQL statement into Opus Script, inside the " ;" marks.
//  Note:    sqliteodbc  is from Chris Werner // dhSQLite3 is from www.thecommon.net (datenhaus)
//

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Twist the Knob, open a door? Can we get to embedded SQLite.
PostPosted: May 7th, 2008, 3:45 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I did some SQLite testing and was pleased with the results... very easy (well, relatively 'very'). I had downloaded the engine from datenHaus, and also their DirectCOM.DLL thinking that was 'a next step' beyond ODBC.

I inquired with Olaf Schmidt of datenHaus.de and he has been gracious enough to provide some definitive answers. More than I'd ever expect. Thank you, Olaf.

The short answer is: 'No', their COM wrapper cannot be used from OpusPro.

Good news, is there is a long answer. I've included our email exchange below. Perhaps with the information provided by Olaf there can be some 'breakthrough' to get a solution... think: ship an embedded open-source, small-footprint DB with your Opus publication, and not require client ODBC.

Any takers? DW? Any bandwidth at DW to put on a summer intern?

Thanks again O.S.
Quote:
But if your new (Std-)Dll-CallingMechanism in Opus works good and reliable (maybe also for the cDecl- Calling-Convention), then you are fine and can write your own Wrapper with Opus-Script, directly working against the exported functions of the original sqlite3.dll from www.sqlite.org. Should work much faster, than going through an additional ODBC-layer, as you got working currently.

The SQLite-flat-API is very good documented and the functions of sqlite3.dll are listed here:
http://www.sqlite.org/c3ref/funclist.html
Don't be scared, for a simple wrapper you will need only ca. 6-10 functions to implement.

The above is an excerpt from the email. Full copy attached.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Pushing ahead...
PostPosted: May 7th, 2008, 7:36 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I've set up a simple script to try out Olaf's suggestions.

Using Opus Publication Properties >>> Addtional Resources, I added 3 files:
( had to use "All Files" *.* to 'see' these and add. )
sqlite3.def
sqlite3.dll
NWind ( DB )


Here are the two commands needed to accomplish (adapt to Opusscript )
Code:
int32Success = sqlite3_open(strZeroterminatedPath, int32DBHdl)
// and later...
int32Success = sqlite3_close(int32DBHdl)
(note to the casual readers here: the above IS NOT opusscript... not proper construction/syntax)

Here is what I tried:
Code:
function dowithoutODBC()
{
var int32Success = 99 ;
test1 = "entered func do_without" ;
var MyDLL = LoadDLL( SYSTEM_PUBLICATION_DIR +"Resource\\"+ "sqlite3.dll" );
test2 = MyDLL ;
   if ( MyDLL )
   {
   int32Success = MyDLL.CallFn(SYSTEM_PUBLICATION_DIR +"Resource\\","sqlite3_open","int32DBHdl",int32Success);  // just a guess how this might work
   test3 = int32Success  ;
   }  //end if
} //end func dowithoutODBC
//
//  the test1,2,3  are Page Vars to display results.
//  the sqlite3.dll  file was added via Publication Properties, and does exist in the Resource folder
// 

Results... 'test2' returns 'DLLObject'
'test3' returns -1 (so far) [Edit: that's minus 1, should be 1 if opens successfully]

How to get this:
COM or ActiveX (??) int32Success = sqlite3_open(strZeroterminatedPath, int32DBHdl)
into this:
Opus: int32Success = MyDLL.CallFn("???","???", ??? ??? ???);

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group