Microsoft Programmer Guide

Microsoft Programmer Guide

Post by Ken Shapir » Sat, 24 Mar 2001 13:43:46



I recently purchased Visual Basic.  I am trying to learn how to program by
studyoing the Microsoft Programmer's Guide.  Occasionally I run into brick
walls.  I am looking for someone or group to help me get over hurdles.

Right now I am stuck on page 265.  I am trying to connect a datagrid control to
the Northwind data base.

First you add an Ado Data Control.  The connectionstring is easy.  I am having
trouble with the record source.  The book gives the example

Select * From MyTableName Where CustID = 12

When I type this into the SQL Space I get an error message telling me that the
bata base cannot be found.  I cannot figure out what is the correct SQL
statement.  If anyone can help please let me know.  

 
 
 

Microsoft Programmer Guide

Post by Ken Shapir » Sat, 24 Mar 2001 13:43:52


I recently purchased Visual Basic.  I am trying to learn how to program by
studyoing the Microsoft Programmer's Guide.  Occasionally I run into brick
walls.  I am looking for someone or group to help me get over hurdles.

Right now I am stuck on page 265.  I am trying to connect a datagrid control to
the Northwind data base.

First you add an Ado Data Control.  The connectionstring is easy.  I am having
trouble with the record source.  The book gives the example

Select * From MyTableName Where CustID = 12

When I type this into the SQL Space I get an error message telling me that the
bata base cannot be found.  I cannot figure out what is the correct SQL
statement.  If anyone can help please let me know.  

 
 
 

Microsoft Programmer Guide

Post by Paul Thornet » Sun, 25 Mar 2001 08:41:56



Quote:>I recently purchased Visual Basic.  I am trying to learn how to
program by
>studyoing the Microsoft Programmer's Guide.  Occasionally I run into
brick
>walls.  I am looking for someone or group to help me get over

hurdles.

Quote:>First you add an Ado Data Control.  The connectionstring is easy.  I
am having
>trouble with the record source.  The book gives the example
>Select * From MyTableName Where CustID = 12
>When I type this into the SQL Space I get an error message telling me
that the
>bata base cannot be found.  I cannot figure out what is the correct
SQL
>statement.  If anyone can help please let me know.

You're supposed to replace MyTableName with a valid table name!!!

In my version of the NorthWinds database, the following works:

   Select * From Customers Where CustomerID = "ANTON"

You may have a different version of the database where any of the
following may be true:
- CustId is really called CustomerId, or perhaps something else
- CustomerId is not numeric, as your example implies, but
alphanumeric, so its parameter value must be enclosed in quotes
- CustomerId does not have a cusomer 12, but does have "ANTON"

Try having a look at your version of the NorthWind database, either
with some version of Access, or perhaps with an Access viewer, if you
can find one.

Good luck!

--
Paul Thornett

Help fight Alzheimer's, Cystic Fibrosis and Mad Cow Disease
http://www.stanford.edu/group/pandegroup/Cosm/