open a database

Just starting out? Need help? Post your questions and find answers here.
nad
Posts: 13
Joined: Sat Feb 10, 2024 1:41 pm

open a database

Post by nad »

I'm trying to open a sqlite database..
I'm having trouble trying to understand the steps involved.
I tried; OpenDatabase(1,"c:\rbp101\projects\foodbank_project\data\fb.db") But get errors.
So how do I open the database..
Thanks for the help..
Dan
User avatar
Paul
Posts: 210
Joined: Wed Feb 26, 2014 6:46 pm
Location: Canada
Contact:

Re: open a database

Post by Paul »

Did you look at the 2 examples in the Help file under Database...
Database.sb
DatabasePersistent.sb

That would be the best place to start to get a good understanding.
nad
Posts: 13
Joined: Sat Feb 10, 2024 1:41 pm

Re: open a database

Post by nad »

I looked at all the examples and can't see openDatabase.
I see where they test openDtatbase to see if it was opened and if not create a database.
I suspect the openDatabase does not support SQLite.

Maybe I should move on and find a language that opens sqlite databases.

Thanks for the help anyway..
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: open a database

Post by Peter »

nad wrote: Thu Feb 15, 2024 2:33 pmMaybe I should move on and find a language that opens sqlite databases.
Good luck
nad
Posts: 13
Joined: Sat Feb 10, 2024 1:41 pm

Re: open a database

Post by nad »

Thanks for your advice. I think I found what I was looking for.
I'm sure as spiderBasic matures, it will have support.
I like the concept of spiderBasic, and will continue to have interest.

Thanks everyone for your support.
plouf
Posts: 295
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: open a database

Post by plouf »

just for info , in case OP or anyone else is looking

Spiderbasic as a WEbApp only creates databases which are hold localy in browsers "temporary" memory
is very dificult to access local disk databases

databases from spiderbasic created in browser memory so you can not access them in windwos exploerer, and offcourse if you "clear browser memory" they all erased
Christos
User avatar
skywalk
Posts: 55
Joined: Tue Feb 25, 2014 2:13 am
Location: Boston, MA

Re: open a database

Post by skywalk »

nad wrote: Thu Feb 15, 2024 12:35 pm I'm trying to open a sqlite database..
I'm having trouble trying to understand the steps involved.
I tried; OpenDatabase(1,"c:\rbp101\projects\foodbank_project\data\fb.db") But get errors.
So how do I open the database..
Thanks for the help..
Dan
Did you try PureBasic?
When working toward the solution of a problem, it always helps if you know the answer. ~ ?
An expert is one who knows more and more about less and less until he knows absolutely everything about nothing. ~ Weber
nad
Posts: 13
Joined: Sat Feb 10, 2024 1:41 pm

Re: open a database

Post by nad »

I've never used pureBasic. I looked at it and I like it.
I was trying to figure out if pureBasic could open a server in the code. Or does it require something like Apache as a server.
Maybe I missed it, but I couldn't find docs on how to set it up to be standalone as server or how to do it with Apache.
I'm currently trying PHP, and just don't like the syntax . I still like the basic type code. Basically the programs require a lot of interaction wiht the database.
I have a system of about 50 programs and a database of about 30 tables. Originally written in runBasic, but runBasic left the ship to sink. So pureBasic would be a natural for me anyway.
Thanks for the help.
plouf
Posts: 295
Joined: Tue Feb 25, 2014 6:01 pm
Location: Athens,Greece

Re: open a database

Post by plouf »

all the above you said can be combined

PureBasic CAN create a "webserver" (apache style) check purebasci examples -> "Atomic webserver"
Purebasic CAN request other http servers/download http paegs/ download files/ connect to SQL server/ create databases

the ONLY thing Purebasic CANNOT do is to write a "webbased client" i.e the client side javascript/HTML you see in webbrowsers the so called "WebApp"
this can be done in Spirebasic which is ALMOST identical syntax, sometimes also identical

but clearly depends on what you want to do
if for example you have a "pc based 'app'" that connect to database request data, and exports them in a simple html in a web browser
this can be done direclty and only in Purebasic
if on the other hand you want to do a more sophisticated client that runs INSIDE webbrowser, you need Spiderbasic
if both of these interact you can use both

you can also use SpiderBasic webapps and "talk" to php webserver too, all of these are possible

....if you explain a bit your "50 programs" or give us one exampel of this may help
Christos
nad
Posts: 13
Joined: Sat Feb 10, 2024 1:41 pm

Re: open a database

Post by nad »

The system is winery management. Probably the most complex system I'v done. I've had lots of db experience.One complex system I was lead for installing HR, Payroll, Benefits for some of the largest Cities, like LA and Seattle. Plus others.
PeopleSoft has about 3500 tables. Just trying to figure out where data was located was a major problem.

The winery system isn't as big but the database system is more complex. The last winery system I set up, had about 1000 tanks, with an average of about 800,000 gallons each. Lots of Bill of Material tracing where wine came from and where it went.  It tracked variety, area,year, gpt, wlp,gl, percent each time wine was pumped from several tanks to one or one to many. It also tracked wine loss to process (wlp), and gain and loss gallons (gl). The gpt, gallons per ton was always altered to reflect true gpt. Knowing gpt and cost of crushing grapes gives a true cost at any point in time you want to search.Doing tank lineup, it tries to find the best pipes to connect when pumping. Similar to the Traveling Salesman system.They had about 2500 pipes running all over the tank farm to choose from.
Wish I could give you a url, but I have it set up for PHP now.

If this looks feasible, I'd sure be interested. I have time to find a language, and so far I've tried Python and PHP. Not too impressed with either. I can post a program if it will help..
Thanks everyone for the help..
Post Reply