Обсуждение: Step 1 with Visual Basic

Поиск
Список
Период
Сортировка

Step 1 with Visual Basic

От
Gary
Дата:
Hello,

I would like to use VB6 to create a report.  I've never use a database
before.

Can someone point me to some information and examples.

Thanks,

Gary

Re: Step 1 with Visual Basic

От
"Richard Broersma"
Дата:
On Tue, Jun 17, 2008 at 7:32 AM, Gary <sql@4myad.tv> wrote:

> I would like to use VB6 to create a report.  I've never use a database
> before.
>
> Can someone point me to some information and examples.

Do you already have a working PostgreSQL database that you will be
working with?  What report engine will you be using?

I've don't have a copy of VB6 at work.  But using VB for applications,
I was able to embed a Crystal Reports Viewer into one of my forms. To
make all of this work, you need three things:

1) An understanding of SQL, to get at (and possibly aggregate) your
data before it is processed by your report.
2) An understanding of your report software. (you need to be able to
create and format the report.)
3) An understanding of how to embed your report view into your VB application.
[opt.4] If you are trying to design your own database from scratch,
then you will need an understanding of Conceptual database schema
design, Normalization rules, and a working knowledge of your
postgresql server.


--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

Re: Step 1 with Visual Basic

От
"Obe, Regina"
Дата:
Gary,
 
Are you using VB6 or VBA.  VBA is the flavor of Visual Basic that is built in MS Access and other office applications and is of the VB6 lineage.  VB6 is the stand alone environment built for doing stand alone applications.  My understanding is that Microsoft has deprecated VB6 and for example one of my friends who really liked VB6 switched to PowerBasic (or is it RealBasic) because of that fact.  If that is the case and you are starting off, you would be better off going with VB.NET.  VB.NET is unfortunately not quite as easy to learn as VB6, but I tend to like it more tha VB6 since it provides stricter framework for designing apps.
 
If you are a complete newbie to databases and reporting, I would suggest starting off with something like MS Access which already has a report writer (and quite a good one I must say) built in.  For that all you will need is the ODBC driver for Postgresql and link all your tables in.  MS Access is actually the way I got started with relational databases and reporting because you can use the designer to build a query and then look at the SQL source to see how it formed the SQL and its got wizards galore to get you started and you can export tables and to other databases or link to all sorts of databases.  Once you feel comfortable with that then things like Crystal Reports, Active Reports, SQL etc are a lot less threatening looking.
 
Hope that helps,
Regina


From: pgsql-novice-owner@postgresql.org on behalf of Gary
Sent: Tue 6/17/2008 10:32 AM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] Step 1 with Visual Basic


Hello,

I would like to use VB6 to create a report.  I've never use a database
before.

Can someone point me to some information and examples.

Thanks,

Gary

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice


The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.


Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper.

Re: Step 1 with Visual Basic

От
"Richard Broersma"
Дата:
On Tue, Jun 17, 2008 at 1:00 PM, Gary <sql@4myad.tv> wrote:
> 1.  I'm clicking on Reply.  Is this only going to you and if so should I be
> doing something different?

Ya.  Reply-All is for the benifit of the whole PostgreSQL Community.
This way others listening in can benifit from the discussion and
people more experienced or smarter that I can chime in to correct my
mis-information :o) .  Also the answer is posted to the PostgreSQL
Archieves.  This way the answers are stored for others to research
later.

> 2. I know the username and password of the database, nothing else.  When I
> first installed the application, I have a vague memory of doing something
> and getting "dos looking" window with a prompt.  I believe I had to enter /q
> to exit.  I don't remember what I did to get that far.

these should fill in the missing details
http://www.connectionstrings.com/?carrier=postgresql about connection strings
http://msdn.microsoft.com/en-us/library/ms807027.aspx about connection.open
http://support.sas.com/documentation/tools/oledb/rr_sqliomshare.htm

> 3. I understand about 50% of your example.  I need to back up to the
> beginning.  Where do I look for "SQL for Dummies?"

Well, I think there are too many SQL dummies out there, so I would
recommend this book instead ;) :
http://www.elsevier.com/wps/find/bookdescription.cws_home/706077/description#description

--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

Re: Step 1 with Visual Basic

От
Gary
Дата:
Richard Broersma wrote:
<blockquote
 cite="mid:396486430806171438r7fe37c71x83c23371cb744b1e@mail.gmail.com"
 type="cite">
  On Tue, Jun 17, 2008 at 1:00 PM, Gary <sql@4myad.tv> wrote:


    1.  I'm clicking on Reply.  Is this only going to you and if so should I be
doing something different?



Ya.  Reply-All is for the benifit of the whole PostgreSQL Community.
This way others listening in can benifit from the discussion and
people more experienced or smarter that I can chime in to correct my
mis-information :o) .  Also the answer is posted to the PostgreSQL
Archieves.  This way the answers are stored for others to research
later.



    2. I know the username and password of the database, nothing else.  When I
first installed the application, I have a vague memory of doing something
and getting "dos looking" window with a prompt.  I believe I had to enter /q
to exit.  I don't remember what I did to get that far.



these should fill in the missing details
http://www.connectionstrings.com/?carrier=postgresql about connection strings
http://msdn.microsoft.com/en-us/library/ms807027.aspx about connection.open
http://support.sas.com/documentation/tools/oledb/rr_sqliomshare.htm



    3. I understand about 50% of your example.  I need to back up to the
beginning.  Where do I look for "SQL for Dummies?"



Well, I think there are too many SQL dummies out there, so I would
recommend this book instead ;) :
http://www.elsevier.com/wps/find/bookdescription.cws_home/706077/description#description



Sorry to be such a pest.  If I could understand these documents I
probably wouldn't have to read them.  I've been zipping around the net
reading docs but nowhere do they start at the beginning.

I've rediscovered how to start the interactive terminal and even listed
the commands.  Might as well be in Chinese.

I've searched and Googled but I don't know the jargon and can't get
close to the right topic.

Seems like step 1 might be to determine the names of the data fields in
the database. (tables & ?).  How do I do that?

Is there a newsgroup with "training wheels"?

Thanks,

Re: Step 1 with Visual Basic

От
"Bret Fledderjohn"
Дата:
2008/6/17 Gary <sql@4myad.tv>:
Richard Broersma wrote:
On Tue, Jun 17, 2008 at 1:00 PM, Gary <sql@4myad.tv> wrote:
1.  I'm clicking on Reply.  Is this only going to you and if so should I be
doing something different?
Ya.  Reply-All is for the benifit of the whole PostgreSQL Community.
This way others listening in can benifit from the discussion and
people more experienced or smarter that I can chime in to correct my
mis-information :o) . Also the answer is posted to the PostgreSQL
Archieves. This way the answers are stored for others to research
later.
2. I know the username and password of the database, nothing else.  When I
first installed the application, I have a vague memory of doing something
and getting "dos looking" window with a prompt. I believe I had to enter /q
to exit. I don't remember what I did to get that far.
these should fill in the missing details
http://www.connectionstrings.com/?carrier=postgresql about connection strings
http://msdn.microsoft.com/en-us/library/ms807027.aspx about connection.open
http://support.sas.com/documentation/tools/oledb/rr_sqliomshare.htm
3. I understand about 50% of your example.  I need to back up to the
beginning. Where do I look for "SQL for Dummies?"

Well, I think there are too many SQL dummies out there, so I would
recommend this book instead ;) :
http://www.elsevier.com/wps/find/bookdescription.cws_home/706077/description#description
Sorry to be such a pest.  If I could understand these documents I probably wouldn't have to read them.  I've been zipping around the net reading docs but nowhere do they start at the beginning.

I've rediscovered how to start the interactive terminal and even listed the commands.  Might as well be in Chinese.



I've searched and Googled but I don't know the jargon and can't get close to the right topic.

Seems like step 1 might be to determine the names of the data fields in the database. (tables & ?).  How do I do that?

Is there a newsgroup with "training wheels"?
 

I found this to be a GREAT resource for learning SQL:  The Practical SQL Handbook ... here's a link to Amazon  http://www.amazon.com/Practical-SQL-Handbook-Using-Variants/dp/0201703092/ref=sr_1_1?ie=UTF8&s=books&qid=1213748053&sr=8-1

-Bret




Thanks,






--
- Bret

Re: Step 1 with Visual Basic

От
"Richard Broersma"
Дата:
On Tue, Jun 17, 2008 at 4:58 PM, Gary <sql@4myad.tv> wrote:
>
> Sorry to be such a pest.  If I could understand these documents I probably
> wouldn't have to read them.  I've been zipping around the net reading docs
> but nowhere do they start at the beginning.

Okay.  Well, I'll try to give a little background information.
PostgreSQL is a Relational Database Management System (RDBMS).
Basically it purposed is to 1) implements and maintains physical
data-patterns that were defined to by a users conceptual database
design, 2) to safely accept and store data into the physical pattern,
3) return sets of data from the data pattern upon client request,  4)
change the data (and sometimes the data-pattern ) that it stores.

Note:  A database data-pattern is usually referred to as a schema.
The schema is an implementation of how a particular database works
together as a whole.

PostgreSQL is installed with several shell/MS-DOS based client
programs that interact with PostgreSQL for the purposes of doing step
1 thru 4.  The one that is most useful is psql (or psql.exe for a
windows installation).  However, psql purpose is mostly to achieve
step 1.

Now there is an important distinction that needs to be made between
PostgreSQL and a Database.  PostgreSQL is a RDBMS. While a database
contains the physical implementation of a particular schema.
Basically Postgresql gives the breath of life to a database.

Another point to make about a database, is that a database is only as
good as the Conceptual Design that it implements.  A good analogy
might be:  PostgreSQL is to Microsoft Word, in the same way as a
database is to a Word document, and continuing the illustration, the
text of in a Word document is to a database Conceptual design/schema.
The purpose of the conceptual design is to adequately model the
reality of whose data one would want to store.  This is necessary
since the designer wants to capture not only the important aspects of
the reality, but also how these aspects interrelate with one another.

So to make a valid point.  A person who has no sense of spelling or
grammar should never expect to use MS-Word to create the worlds best
novel or poetry.  Also a person who has no sense of conceptual
database design/ data modelling could ever expect to make a workable
database.  Not to say that this can't be done.  But in either case the
person must first learn the applicable skill for the task.

Up to this point we've said nothing about how to access this database.
 And we've not mentioned how to do analysis on the data based upon the
relationships the exists between the data in a particular database.
This is where the Language of SQL comes into play.

Lastly as Client front-end programs also want to access that database
of the database.  For the purpose of recording the important data of a
particular reality( usually a business process ).  The Client
application needs to know information about the PostgreSQL Server
(server ip, Postgresql ip port, Postgresql database of interest, the
user and password that will be used to connect),  the database ( the
database schema(data model), all of the tables, constraints, views,
indexes), and the SQL queries that it will use to efficiently interact
with that database.

> I've rediscovered how to start the interactive terminal and even listed the
> commands.  Might as well be in Chinese.
I understand.  If you read Chapters one and two it should answer
mosted of the basic questions:
http://www.postgresql.org/docs/8.3/interactive/tutorial-start.html


> Seems like step 1 might be to determine the names of the data fields in the
> database. (tables & ?).  How do I do that?

psql -U <yourdbusername> -d <databasename>

# \dt  --list all the table in the public schema
# \d <a particular table name>  -- see the columns of the table
#\?  -- where to look for other useful commands

> Is there a newsgroup with "training wheels"?

This is the correct mailing list.  However, instead of asking broad
vague questions.  It is much better to ask many small specific
questions to specific mailing lists.

good questions example:
-- I cant' connect using psql.  It throwing this error.  What do I do?
-- I cant connect using ODBC.  This is the error message when I try.

bad question example:
-- I don't get it.  What do I do?


Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

Re: Step 1 with Visual Basic

От
"Richard Broersma"
Дата:
On Tue, Jun 17, 2008 at 4:58 PM, Gary <sql@4myad.tv> wrote:

> Is there a newsgroup with "training wheels"?

I haven't heard anything back.  Were you able to connect to PostgreSQL
using Visual Basic?

--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug