PowerBASIC Forums
  Programming
  shared database help (Page 2)

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone!
This topic is 2 pages long:   1  2 
next newest topic | next oldest topic
Author Topic:   shared database help
Don Dickinson
Member
posted May 27, 2004 01:07 PM     Click Here to See the Profile for Don Dickinson     Edit/Delete Message   Reply w/Quote
none of you guys can compare to "Lothar Pink". I know this came before and it's legit, but his name sounds like something out of a superman cartoon. cool name Lothar
--don

------------------
Don Dickinson
Author of ddoc Print and Preview A dll-based print-preview engine for windows
www.greatwebdivide.com
Author of Tsunami Tcp Data Server
http://ttds.greatwebdivide.com

IP: Logged

Brad D Byrne
Member
posted May 27, 2004 09:20 PM     Click Here to See the Profile for Brad D Byrne     Edit/Delete Message   Reply w/Quote
I Agree!!

"Lothar Pink" Rocks!!!

I'm gonna name my next son that

------------------
Washington DC Area
Borje's "Poff's" is likely the BEST tool for learning PB.. http://www.tolkenxp.com/pb
And a few PBTool's & Beginner Help:http://sweetheartgames.com/PBTools/JumpStart.html

IP: Logged

Shawn Anderson
Member
posted May 27, 2004 10:41 PM     Click Here to See the Profile for Shawn Anderson     Edit/Delete Message   Reply w/Quote
That would be a great name for a band: "Lothar Pink".
We had a popular band around here called "Lynn Allen".
It follows after the band name I thought of while playing
scrabble the other night: "JiggyLint". Also, the name of an
80's metal cover band should be "Great-White-Lion-Snake". No, my wife
wouldn't let me use "JiggyLint" during the game. And....what does that have
to do with a database again?

------------------
http://www.nbson.com
CIW, A+

IP: Logged

Donald Darden
Member
posted May 28, 2004 12:23 AM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
Seems we have gotten a bit off topic.

Relating to databases, you don't start building something as
complex as the Empire State buiding until you have built your
share of humble dwellings with simple tools. And building
anything means dealing with problems in design and planning
as the occur to you.

The answers concerning locks and sharing were good ones, and
these involve the OPEN statements when you access files. When
you CLOSE a file you release it so that some other client can
then access it. To improve efficiencies, it is common to
SHARE files when the users only need read access to the content,
and are not planning on making changes. A LOCK is only needed
if the contents of the file are expected to be changed by a
write operation. This prevents other users from getting a mix
of information that consists of a partial record change, which
would then be incorrect.

However, it is really unnecessary to try and build a whole
database from scratch, since there are many available databasing
products that PowerBASIC can interface to which will take care
of the untidy details for you. For one thing, most support
record locking instead of whole file locking, which lessens the
chances that the same users will be in conflict with each other.
Some use a journal of changes, so that you can roll back at any
point if a transaction is incomplete, such as the network goes
down or a machine fails while a change is underway. A history
file also can be used to verify what changes were made and who
made them - an important consideration when it comes to
validating any changes made later on.

Many of the available databases are free, and some include good
examples of how to link up to them through your own program.
Usually, these examples cover the use of simple script files,
VB, C, Pascal, and similar examples that can easily be adapted.

The most powerful databases are generally the relational ones.
This just means that all the data is not placed in a single
database, but in related databases. You can add new databases
without effecting the original ones as new needs and more data
comes into being. The relationships between the different
databases is described in a series of templates, so as you add
new databases, you modify or extend the range of templates.

A big push is to try and access relational databases with a
relational language, of which SQL (Standard Query Language) is
probably the best known. Database users learn SQL, then they
can work with any database that supports the language, and there
are many. You can also program these databases externally by
the use of SQL, meaning just sending the right commands as
though you were a user.

So my suggestion is to consider getting familiarized with a
relational database, preferably one that supports SQL, and
once you have actually used it to set up your database, you can
consider either automating tasks with its built-in language,
or of trying to manipulate it with a separate program written
in your programming language of choice. MySQL is a good free
one, from the reports I've read. One that is often available
in an office that uses Windows is Microsoft's Access. Access
is probably the preferred choice up to about 25 users.

Keep in mind that originally, you only need to focus on the
single user aspects of setting up and using the database. As you
identify who the other users are, and what their roles will be,
you can focus on how the database is to be administered and what
rights each person or PC is going to be allowed.

I have seen some discussions on working with various databases
using PowerBASIC, so don't give up on the idea of doing more
research and reading on the topic.

It is much easier to contemplate working with a database if you
approach the problem by steps, and not leap at the whole thing
without focusing on what needs to be done first. And there is
no reason you cannot attempt a course on the subject - perhaps
one of the free online courses that you can find with a search.
These will take you through the elementary steps of setting up
and using your first database.

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged

Gian Kolbjornsen
Member
posted May 28, 2004 02:08 AM     Click Here to See the Profile for Gian Kolbjornsen     Edit/Delete Message   Reply w/Quote
Apollo from http://www.vistasoftware.com
is dbase based, however it supports SQL-92.

They also have a server and relay server.

Product comes as:

api
.net
asp
com
ole db
vcl

Gian

------------------

IP: Logged

Elias Montoya
Member
posted May 28, 2004 03:25 AM     Click Here to See the Profile for Elias Montoya     Edit/Delete Message   Reply w/Quote

I didnt found info for the last one

------------------
Last night i was decided to retreat, Then i decided not to.

Do you need a grid In your App?.... Try the Egrid32 Demo:
EGRID32 DEMO DOWNLOAD
PRO Version Released!
Egrid32's Page

IP: Logged

Knuth Konrad
Member
posted May 28, 2004 04:50 AM     Click Here to See the Profile for Knuth Konrad     Edit/Delete Message   Reply w/Quote
quote:
Originally posted by Elias Montoya:

I didnt found info for the last one



VCL = Borland Delphi component (sort of PB's *.PBU)

Knuth

------------------
http://www.softAware.de

IP: Logged

Mike Doty
Member
posted May 28, 2004 05:22 PM     Click Here to See the Profile for Mike Doty     Edit/Delete Message   Reply w/Quote
'Jazmin, there is always the direct I/O method

#DIM ALL 'lock, get, put, unlock
FUNCTION PBMAIN AS LONG
DIM hFile&,Fname$,RecordLength&,RecNum&,Attempt&,MaxAttempts&
DIM Buffer$,RecordsToWrite&,ByteNum&
maxAttempts& = 10
RecordLength& = 20
RecordsToWrite& = 1
DO
ERRCLEAR
hFile& = FREEFILE
fName$ = "DATA.TXT"
OPEN Fname$ FOR BINARY LOCK SHARED AS #hFile& LEN = recordLength&
IF ERR THEN
INCR Attempt&
SLEEP 100
END IF
LOOP UNTIL ERR = 0 OR Attempt& => MaxAttempts&

IF Attempt& => MaxAttempts& THEN
MSGBOX "Can't open" & STR$(ERRCLEAR)
GOTO ExitProgram
END IF

Attempt& = 0
DO
ERRCLEAR
LOCK #hFile 'lock entire file
IF ERR THEN
INCR Attempt&
SLEEP 100
END IF
LOOP UNTIL ERR = 0 OR Attempt& => MaxAttempts&
IF Attempt& => MaxAttempts& THEN
MSGBOX "Unable to lock file" & STR$(ERRCLEAR)
GOTO ExitProgram
END IF

buffer$ = SPACE$(RecordLength&)
FOR RecNum& = 1 TO RecordsToWrite&
ByteNum& = LOF(#hFile) + 1
LSET buffer$ = STR$(RecNum&) & "YOUR DATA"
PUT #hFile,ByteNum&,buffer$
NEXT
FLUSH #hFile
UNLOCK #hFile
MSGBOX "Bytes in file" & STR$(LOF(hFile))
CLOSE #hFile
ExitProgram:
EXIT FUNCTION
ErrorTrap:
MSGBOX "The following error occurred" & STR$(ERRCLEAR)
RESUME ExitProgram
END FUNCTION

[This message has been edited by Mike Doty (edited May 28, 2004).]

IP: Logged

Elias Montoya
Member
posted May 28, 2004 07:47 PM     Click Here to See the Profile for Elias Montoya     Edit/Delete Message   Reply w/Quote

Just 1 question, what is wrong with the name "Jazmin"?...
i know not many people here has "Stevens" as last name, but
there are a lot of girls named Jazmin. It is also the name
of a flower.

¿?

By the way, jazmin says thanx for all your replies!!!

Elias

------------------
Last night i was decided to retreat, Then i decided not to.

Do you need a grid In your App?.... Try the Egrid32 Demo:
EGRID32 DEMO DOWNLOAD
PRO Version Released!
Egrid32's Page

IP: Logged

José Roca
Member
posted May 28, 2004 09:10 PM     Click Here to See the Profile for José Roca     Edit/Delete Message   Reply w/Quote
Nothing between Spaniards, Elías. But as Tom said, to err is human.
In Spanish "jazmín" is not the name of a flower, but the name of a
plant. The flower of this plant is called "flor de jazmín".
This word cames from the ancient Persia and means "flower of the hope".
It was introduced in Spain by the Arabs.

------------------

IP: Logged

Elias Montoya
Member
posted May 28, 2004 10:44 PM     Click Here to See the Profile for Elias Montoya     Edit/Delete Message   Reply w/Quote

Oh... ok. I just wanted to make sure it was not some kind of
a bad word in english.

------------------
Last night i was decided to retreat, Then i decided not to.

Do you need a grid In your App?.... Try the Egrid32 Demo:
EGRID32 DEMO DOWNLOAD
PRO Version Released!
Egrid32's Page

IP: Logged


This topic is 2 pages long:   1  2 

All times are EasternTime (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | PowerBASIC BASIC Compilers

Copyright © 1999-2005 PowerBASIC, Inc. All Rights Reserved.


Ultimate Bulletin Board 5.45c