Discussion:
query an Access_db via a net GUI
(too old to reply)
unknown
2005-08-31 22:01:28 UTC
Permalink
Were I writing an application to be installed on each user's computer to
access a database on a network, I'd use PowerBASIC/Windows.
Then again, I've been using PB/Windows/database for five years, so it's no
big deal. But when I first started database access, learning the ODBC API
was a dog of a job. There are some third-party tools to ease the load (e.g.,
PerfectSync's SQL Tools), and with the current versions of the compilers
there is a COM interface. There's also (now, not then!) a large collection
of code posted at PowerBASIC's web site from which to start.
In general, PowerBASIC is not a "point and shoot" tool. It provides a very
reliable platform to make calls to the Windows' API. Microsoft's Visual
Basic has a much, much simpler programmer interface to database access. If
you are in fact a 'newbie' and just starting with Windows programming, be
prepared to invest a lot of time getting this to work correctly if you want
to write a program using PB/Windows..
Visual basic is an erector set or a set of Lego Blocks.

PowerBASIC is a fully-equipped machine shop.
Michael Mattias
2005-08-31 22:52:48 UTC
Permalink
Post by unknown
Visual basic is an erector set or a set of Lego Blocks.
PowerBASIC is a fully-equipped machine shop.
Perhaps, but the MS-VB "program code needed to work with databases" is a
hell of lot easier to read, write and understand than is the ODBC API.

I think it's something like (I don't write in VB)...

DIM DB AS DatabaseObject, RS as RecordSet
DB.ConnectString = "connection string" ' need this for ODBC , too
Connected = DB.Connect (DB)
IF Connected then
DB.Statement = "SQL statement"
DB.Execute DB.Statement, RS
FOR Z = 1 TO RS.NumRows
MyRecord = RS (Z).rowdata
(do stuff with MyRecord)
NEXT
RS.Close
DB.Disconnect
END IF

I have the same 'connnect, execute, retrieve results, close, disconnect'
functions in my personal #INCLUDE file but it took me about 1000 lines of
code to make it so.

MCM
DDG
2005-09-01 02:49:06 UTC
Permalink
Thanks so the group isn't dead, just appears that way. Thanks again
sounds like a large task if I chose to take it. I'm playing with making
the searches in access via an .htm output currently with limited
success. Still have a couple other options I guess like net.asp using
vb as I think your suggesting. Not sure I've got enough time to start
from pb scratch after reading the few comments.

- Again glad to know the site is alive.

:)
unknown
2005-09-01 07:36:14 UTC
Permalink
"Guy Macon" <http://www.guymacon.com/> wrote...
Visual basic is an erector set or a set of Lego blocks.
PowerBASIC is a fully-equipped machine shop.
Perhaps, but the MS-VB "program code needed to work with databases" is a
hell of lot easier to read, write and understand than is the ODBC API.
Of course it is. calling VB "an erector set or a set of Lego blocks"
is not in any way a putdown or criticism. It is an attempt to convey
the fact that VB was designed to do some things so easily that doing
them is like snapping together Lego blocks.

On the other hand, while VB is able to do some things (some of them
quite sophisticated, which is where the Lego analogy breaks down)
very easily, there are some other things that it is very, very hard
to do in VB. You don't see anyone doing real-time control of embedded
hardware in VB -- PB is far better for that. You don't see anyone
writing entire operating systems in VB -- C/C++ is far better for that.
They are different tools designed to address different kinds of problems.
Hammers are a poor choice for cutting wood and saws are a poor choice
for driving nails -- and neither is a good choice for tightening bolts.

One must also keep in mind that in this particular example the deck
is stacked. The title of this thread mentions an *Access* database.
Is it any wonder that Microsoft Visual Basic works well with Microsoft
Access?

I am not a database sort of person (my tastes run more towards industrial
robots and electronic toys), but isn't SQL Tools by Perfect Sync a better
way of working with databases than "rolling your own" in PowerBASIC alone
*or* Visual Basic alone? See http://perfectsync.com/SQLTools.htm
--
Guy Macon <http://www.guymacon.com/>
Michael Mattias
2005-09-01 11:55:05 UTC
Permalink
Post by unknown
I am not a database sort of person (my tastes run more towards industrial
robots and electronic toys), but isn't SQL Tools by Perfect Sync a better
way of working with databases than "rolling your own" in PowerBASIC alone
*or* Visual Basic alone? See http://perfectsync.com/SQLTools.htm
SQL Tools is what it is: a tool. It provides the 'wrapper' functions so the
syntax required of the programmer is a lot less complex than that required
to make all the required calls to the ODBC API. It's either worth the cost
to you or it isn't.

In general I'm not much of a 'tools' user anyway. The only tools libraries I
use at all are Don Dickinson's ddoc Print and Preview (Windows printing plus
on-screen print preview) and PowerBASIC's PowerTree (index manager).

While *today* I could do my own printing, when I first needed to print, I
was new to Windows itself, leave alone new to Windows printing; at only
twenty-five bucks for a ddoc P&P developer license, no way I could have
gotten my first printing application working for less than that.

The PowerTree license I bought during one of PB's sales two-three years ago
(I think it was only ninety-nine bucks during that sales promotion). But it
was just a couple of weeks ago I actually included it in one of my
applications. (Somewhat inexplicably to me, PT does not support the creation
of indexes which permit duplicate keys.. but DOES require the keydata be
supplied when deleting a key. Go figger)

The index management I don't think I could have done myself in less than two
months. Besides, I had used other index managers back in my MS-DOS days, and
as a COBOL programmer for a number of years, the whole concept of doing
indexed I-O simply by making a limited number of function calls ( NOT having
to code up the tree algorithms) was already burned into my brain, so
investing in this tool made a lot of sense.

FWIW, both these libraries are IMO terrific values, even though both suffer
from weak documentation.

MCM
Michael Mattias
2005-09-01 13:32:28 UTC
Permalink
"Michael Mattias" <***@gte.net> wrote in message
news:t_BRe.7416>
Post by Michael Mattias
(Somewhat inexplicably to me, PT does not support the creation
of indexes which permit duplicate keys.. but DOES require the keydata be
supplied when deleting a key. Go figger)
My error, I have this backwards.

PowerTree does not allow the creation of indexes which specify keys must be
UNIQUE. (i..e, "add" would return 'failure' on duplicate key).

So requiring the keydata to specify the key to be deleted *does* make sense
prior to doing a delete!

MCM

unknown
2005-09-01 08:16:04 UTC
Permalink
I have a small windows.access database file that I am thinking of making
available for others to access on my local network. I don't want to
just open the file but rather set up a search screen or so with some
canned routines read-only to the original database. Should
PowerBasic/windows version be a good way to go or is this a worthless
cause to pursue for the newbie with modern window's programming info.
I'm not too bad with VBscript within access but that isn't saying much
either.
Here are some tutorials that should get you going:

Introduction:
http://www.webwizguide.com/asp/tutorials/what_is_asp.asp
http://www.webwizguide.com/asp/tutorials/first_asp_page.asp

Working with an Access Database:
http://www.webwizguide.com/asp/tutorials/connecting_to_a_database.asp
http://www.webwizguide.com/asp/tutorials/connecting_to_a_database_pt2.asp
http://www.webwizguide.com/asp/tutorials/add_to_database.asp
http://www.webwizguide.com/asp/tutorials/add_to_database_pt2.asp
http://www.webwizguide.com/asp/tutorials/deleting_data_from_database.asp
http://www.webwizguide.com/asp/tutorials/deleting_data_from_database_pt2.asp
http://www.webwizguide.com/asp/tutorials/updating_data_from_database.asp
http://www.webwizguide.com/asp/tutorials/updating_data_from_database_pt2.asp
http://www.webwizguide.com/asp/tutorials/updating_data_from_database_pt3.asp
http://www.webwizguide.com/asp/faq/access_database_faq.asp

Or you can try using the Database Interface Wizard in FrontPage:
http://www.microsoftfrontpage.com/content/ARTICLES/dbpower.html
http://msdn.microsoft.com/library/en-us/odc_fp2003_ta/html/odc_FPUsingDIWwFP.asp?
--
Guy Macon <http://www.guymacon.com/>
Loading...