Having problems with SIMPLE query in VB 6 and Access XP, Please Help 
Author Message
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help

Here's a simple query, about as simple as you can get (this is used as my
query string when opening an ADO recordset):

SELECT ContactsGridColumns.columnName, ContactsGridColumns.columnTableName,
ContactsGridColumns.order, ContactsGridColumns.displayed
FROM ContactsGridColumns
WHERE ContactsGridColumns.displayed=Yes
ORDER BY ContactsGridColumns.order;

I'm getting an "No value given for one or more required parameters" error on
rsRows.Open (rsRows being an ADO recordset object).

Okay, I then work the query using access' GUI query designer, then view the
resulting SQL code.  This is what I see:

SELECT ContactsGridColumns.columnDisplayName,
ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
ContactsGridColumns.order
FROM ContactsGridColumns
WHERE (((ContactsGridColumns.displayed)=True))
ORDER BY ContactsGridColumns.order;

Just in case, I added the parens in the WHERE clause to my query string, but
I still get the same error.  Can someone please help?  I'm obviously not
understanding the Access/VB6/ADO way of doing things and would appreciate
any help given.

Thanks!



Mon, 09 May 2005 02:18:59 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
David,

First of all you need to use True or False, but I think problem here is that
your field has nem "Order". Order is a reserved word and you cannot use it
as a filed/table name directly. Try to wrap it into []

SELECT ContactsGridColumns.columnDisplayName,
 ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
 [ContactsGridColumns.order]
 FROM ContactsGridColumns
 WHERE ContactsGridColumns.displayed=True
 ORDER BY [ContactsGridColumns.order];

--
Val Mazur
Microsoft MVP



Quote:
> Here's a simple query, about as simple as you can get (this is used as my
> query string when opening an ADO recordset):

> SELECT ContactsGridColumns.columnName,

ContactsGridColumns.columnTableName,
Quote:
> ContactsGridColumns.order, ContactsGridColumns.displayed
> FROM ContactsGridColumns
> WHERE ContactsGridColumns.displayed=Yes
> ORDER BY ContactsGridColumns.order;

> I'm getting an "No value given for one or more required parameters" error
on
> rsRows.Open (rsRows being an ADO recordset object).

> Okay, I then work the query using access' GUI query designer, then view
the
> resulting SQL code.  This is what I see:

> SELECT ContactsGridColumns.columnDisplayName,
> ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> ContactsGridColumns.order
> FROM ContactsGridColumns
> WHERE (((ContactsGridColumns.displayed)=True))
> ORDER BY ContactsGridColumns.order;

> Just in case, I added the parens in the WHERE clause to my query string,
but
> I still get the same error.  Can someone please help?  I'm obviously not
> understanding the Access/VB6/ADO way of doing things and would appreciate
> any help given.

> Thanks!



Mon, 09 May 2005 02:32:23 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
Hi Val, thanks for responding!

Ok, made the changes, but it still died in same manner.  In the immediate
window I captured the text of my SQL query (spaced properly for displaying
here):

SELECT ContactsGridColumns.columnName, ContactsGridColumns.columnTableName,
[ContactsGridColumns.order], ContactsGridColumns.displayed
FROM ContactsGridColumns
WHERE ContactsGridColumns.displayed=True
ORDER BY [ContactsGridColumns.order];

In case it helps in diagnosing this, here're my ADO calls:

Dim adoConn As ADODB.Connection
Set adoConn = New ADODB.Connection
adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
adoConn.ConnectionString = "Data Source=" & m_strProgramPath &
"\Inventory.mdb"
adoConn.Open

Dim rsRows As ADODB.Recordset
Set rsRows = New ADODB.Recordset
rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly, adCmdText


Quote:
> David,

> First of all you need to use True or False, but I think problem here is
that
> your field has nem "Order". Order is a reserved word and you cannot use it
> as a filed/table name directly. Try to wrap it into []

> SELECT ContactsGridColumns.columnDisplayName,
>  ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
>  [ContactsGridColumns.order]
>  FROM ContactsGridColumns
>  WHERE ContactsGridColumns.displayed=True
>  ORDER BY [ContactsGridColumns.order];

> --
> Val Mazur
> Microsoft MVP



> > Here's a simple query, about as simple as you can get (this is used as
my
> > query string when opening an ADO recordset):

> > SELECT ContactsGridColumns.columnName,
> ContactsGridColumns.columnTableName,
> > ContactsGridColumns.order, ContactsGridColumns.displayed
> > FROM ContactsGridColumns
> > WHERE ContactsGridColumns.displayed=Yes
> > ORDER BY ContactsGridColumns.order;

> > I'm getting an "No value given for one or more required parameters"
error
> on
> > rsRows.Open (rsRows being an ADO recordset object).

> > Okay, I then work the query using access' GUI query designer, then view
> the
> > resulting SQL code.  This is what I see:

> > SELECT ContactsGridColumns.columnDisplayName,
> > ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > ContactsGridColumns.order
> > FROM ContactsGridColumns
> > WHERE (((ContactsGridColumns.displayed)=True))
> > ORDER BY ContactsGridColumns.order;

> > Just in case, I added the parens in the WHERE clause to my query string,
> but
> > I still get the same error.  Can someone please help?  I'm obviously not
> > understanding the Access/VB6/ADO way of doing things and would
appreciate
> > any help given.

> > Thanks!



Mon, 09 May 2005 02:59:27 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
David - try wrapping your column name outside of the table name.
For example, try ContactsGridColumns.[order] instead of
[ContactsGridColumns.order]

If you wanted to wrap the table name *and* column name, it would look like:
[ContactsGridColumns].[order]

Hope that helps.

Jason



Quote:
> Hi Val, thanks for responding!

> Ok, made the changes, but it still died in same manner.  In the immediate
> window I captured the text of my SQL query (spaced properly for displaying
> here):

> SELECT ContactsGridColumns.columnName,

ContactsGridColumns.columnTableName,
Quote:
> [ContactsGridColumns.order], ContactsGridColumns.displayed
> FROM ContactsGridColumns
> WHERE ContactsGridColumns.displayed=True
> ORDER BY [ContactsGridColumns.order];

> In case it helps in diagnosing this, here're my ADO calls:

> Dim adoConn As ADODB.Connection
> Set adoConn = New ADODB.Connection
> adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> adoConn.ConnectionString = "Data Source=" & m_strProgramPath &
> "\Inventory.mdb"
> adoConn.Open

> Dim rsRows As ADODB.Recordset
> Set rsRows = New ADODB.Recordset
> rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
adCmdText



> > David,

> > First of all you need to use True or False, but I think problem here is
> that
> > your field has nem "Order". Order is a reserved word and you cannot use
it
> > as a filed/table name directly. Try to wrap it into []

> > SELECT ContactsGridColumns.columnDisplayName,
> >  ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> >  [ContactsGridColumns.order]
> >  FROM ContactsGridColumns
> >  WHERE ContactsGridColumns.displayed=True
> >  ORDER BY [ContactsGridColumns.order];

> > --
> > Val Mazur
> > Microsoft MVP



> > > Here's a simple query, about as simple as you can get (this is used as
> my
> > > query string when opening an ADO recordset):

> > > SELECT ContactsGridColumns.columnName,
> > ContactsGridColumns.columnTableName,
> > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > FROM ContactsGridColumns
> > > WHERE ContactsGridColumns.displayed=Yes
> > > ORDER BY ContactsGridColumns.order;

> > > I'm getting an "No value given for one or more required parameters"
> error
> > on
> > > rsRows.Open (rsRows being an ADO recordset object).

> > > Okay, I then work the query using access' GUI query designer, then
view
> > the
> > > resulting SQL code.  This is what I see:

> > > SELECT ContactsGridColumns.columnDisplayName,
> > > ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > > ContactsGridColumns.order
> > > FROM ContactsGridColumns
> > > WHERE (((ContactsGridColumns.displayed)=True))
> > > ORDER BY ContactsGridColumns.order;

> > > Just in case, I added the parens in the WHERE clause to my query
string,
> > but
> > > I still get the same error.  Can someone please help?  I'm obviously
not
> > > understanding the Access/VB6/ADO way of doing things and would
> appreciate
> > > any help given.

> > > Thanks!



Mon, 09 May 2005 04:25:18 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
Thanks for the suggestion, Jason, but that wasn't it, either (though no
doubt correct; it certainly sounds right).  Still getting same problem.
Argggh!! :-)  Maybe it's time for me to dump Access and use MySQL...
dunno...


Quote:
> David - try wrapping your column name outside of the table name.
> For example, try ContactsGridColumns.[order] instead of
> [ContactsGridColumns.order]

> If you wanted to wrap the table name *and* column name, it would look
like:
> [ContactsGridColumns].[order]

> Hope that helps.

> Jason



> > Hi Val, thanks for responding!

> > Ok, made the changes, but it still died in same manner.  In the
immediate
> > window I captured the text of my SQL query (spaced properly for
displaying
> > here):

> > SELECT ContactsGridColumns.columnName,
> ContactsGridColumns.columnTableName,
> > [ContactsGridColumns.order], ContactsGridColumns.displayed
> > FROM ContactsGridColumns
> > WHERE ContactsGridColumns.displayed=True
> > ORDER BY [ContactsGridColumns.order];

> > In case it helps in diagnosing this, here're my ADO calls:

> > Dim adoConn As ADODB.Connection
> > Set adoConn = New ADODB.Connection
> > adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> > adoConn.ConnectionString = "Data Source=" & m_strProgramPath &
> > "\Inventory.mdb"
> > adoConn.Open

> > Dim rsRows As ADODB.Recordset
> > Set rsRows = New ADODB.Recordset
> > rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
> adCmdText



> > > David,

> > > First of all you need to use True or False, but I think problem here
is
> > that
> > > your field has nem "Order". Order is a reserved word and you cannot
use
> it
> > > as a filed/table name directly. Try to wrap it into []

> > > SELECT ContactsGridColumns.columnDisplayName,
> > >  ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > >  [ContactsGridColumns.order]
> > >  FROM ContactsGridColumns
> > >  WHERE ContactsGridColumns.displayed=True
> > >  ORDER BY [ContactsGridColumns.order];

> > > --
> > > Val Mazur
> > > Microsoft MVP



> > > > Here's a simple query, about as simple as you can get (this is used
as
> > my
> > > > query string when opening an ADO recordset):

> > > > SELECT ContactsGridColumns.columnName,
> > > ContactsGridColumns.columnTableName,
> > > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > > FROM ContactsGridColumns
> > > > WHERE ContactsGridColumns.displayed=Yes
> > > > ORDER BY ContactsGridColumns.order;

> > > > I'm getting an "No value given for one or more required parameters"
> > error
> > > on
> > > > rsRows.Open (rsRows being an ADO recordset object).

> > > > Okay, I then work the query using access' GUI query designer, then
> view
> > > the
> > > > resulting SQL code.  This is what I see:

> > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > > > ContactsGridColumns.order
> > > > FROM ContactsGridColumns
> > > > WHERE (((ContactsGridColumns.displayed)=True))
> > > > ORDER BY ContactsGridColumns.order;

> > > > Just in case, I added the parens in the WHERE clause to my query
> string,
> > > but
> > > > I still get the same error.  Can someone please help?  I'm obviously
> not
> > > > understanding the Access/VB6/ADO way of doing things and would
> > appreciate
> > > > any help given.

> > > > Thanks!



Mon, 09 May 2005 04:54:32 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
David,

Code looks fine. Try to do next. Remove WHERE condition from your SQL at all
(just for test purposes) see if it help. If not, then eliminate fields from
selection list one-by-one to see which one casues it. Let us know

--
Val Mazur
Microsoft MVP



Quote:
> Hi Val, thanks for responding!

> Ok, made the changes, but it still died in same manner.  In the immediate
> window I captured the text of my SQL query (spaced properly for displaying
> here):

> SELECT ContactsGridColumns.columnName,

ContactsGridColumns.columnTableName,
Quote:
> [ContactsGridColumns.order], ContactsGridColumns.displayed
> FROM ContactsGridColumns
> WHERE ContactsGridColumns.displayed=True
> ORDER BY [ContactsGridColumns.order];

> In case it helps in diagnosing this, here're my ADO calls:

> Dim adoConn As ADODB.Connection
> Set adoConn = New ADODB.Connection
> adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> adoConn.ConnectionString = "Data Source=" & m_strProgramPath &
> "\Inventory.mdb"
> adoConn.Open

> Dim rsRows As ADODB.Recordset
> Set rsRows = New ADODB.Recordset
> rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
adCmdText



> > David,

> > First of all you need to use True or False, but I think problem here is
> that
> > your field has nem "Order". Order is a reserved word and you cannot use
it
> > as a filed/table name directly. Try to wrap it into []

> > SELECT ContactsGridColumns.columnDisplayName,
> >  ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> >  [ContactsGridColumns.order]
> >  FROM ContactsGridColumns
> >  WHERE ContactsGridColumns.displayed=True
> >  ORDER BY [ContactsGridColumns.order];

> > --
> > Val Mazur
> > Microsoft MVP



> > > Here's a simple query, about as simple as you can get (this is used as
> my
> > > query string when opening an ADO recordset):

> > > SELECT ContactsGridColumns.columnName,
> > ContactsGridColumns.columnTableName,
> > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > FROM ContactsGridColumns
> > > WHERE ContactsGridColumns.displayed=Yes
> > > ORDER BY ContactsGridColumns.order;

> > > I'm getting an "No value given for one or more required parameters"
> error
> > on
> > > rsRows.Open (rsRows being an ADO recordset object).

> > > Okay, I then work the query using access' GUI query designer, then
view
> > the
> > > resulting SQL code.  This is what I see:

> > > SELECT ContactsGridColumns.columnDisplayName,
> > > ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > > ContactsGridColumns.order
> > > FROM ContactsGridColumns
> > > WHERE (((ContactsGridColumns.displayed)=True))
> > > ORDER BY ContactsGridColumns.order;

> > > Just in case, I added the parens in the WHERE clause to my query
string,
> > but
> > > I still get the same error.  Can someone please help?  I'm obviously
not
> > > understanding the Access/VB6/ADO way of doing things and would
> appreciate
> > > any help given.

> > > Thanks!



Mon, 09 May 2005 21:14:54 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
Ok this is the last of the queries that I attempted, and it STILL gave me
the same darn error:

SELECT ContactsGridColumns.columnName FROM ContactsGridColumns

Ok, any help on THIS one?  :-(

Just in case, I even tried it as:

SELECT columnName FROM ContactsGridColumns

Same thing.

Help, please!!!


Quote:
> David,

> Code looks fine. Try to do next. Remove WHERE condition from your SQL at
all
> (just for test purposes) see if it help. If not, then eliminate fields
from
> selection list one-by-one to see which one casues it. Let us know

> --
> Val Mazur
> Microsoft MVP



> > Hi Val, thanks for responding!

> > Ok, made the changes, but it still died in same manner.  In the
immediate
> > window I captured the text of my SQL query (spaced properly for
displaying
> > here):

> > SELECT ContactsGridColumns.columnName,
> ContactsGridColumns.columnTableName,
> > [ContactsGridColumns.order], ContactsGridColumns.displayed
> > FROM ContactsGridColumns
> > WHERE ContactsGridColumns.displayed=True
> > ORDER BY [ContactsGridColumns.order];

> > In case it helps in diagnosing this, here're my ADO calls:

> > Dim adoConn As ADODB.Connection
> > Set adoConn = New ADODB.Connection
> > adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> > adoConn.ConnectionString = "Data Source=" & m_strProgramPath &
> > "\Inventory.mdb"
> > adoConn.Open

> > Dim rsRows As ADODB.Recordset
> > Set rsRows = New ADODB.Recordset
> > rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
> adCmdText



> > > David,

> > > First of all you need to use True or False, but I think problem here
is
> > that
> > > your field has nem "Order". Order is a reserved word and you cannot
use
> it
> > > as a filed/table name directly. Try to wrap it into []

> > > SELECT ContactsGridColumns.columnDisplayName,
> > >  ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > >  [ContactsGridColumns.order]
> > >  FROM ContactsGridColumns
> > >  WHERE ContactsGridColumns.displayed=True
> > >  ORDER BY [ContactsGridColumns.order];

> > > --
> > > Val Mazur
> > > Microsoft MVP



> > > > Here's a simple query, about as simple as you can get (this is used
as
> > my
> > > > query string when opening an ADO recordset):

> > > > SELECT ContactsGridColumns.columnName,
> > > ContactsGridColumns.columnTableName,
> > > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > > FROM ContactsGridColumns
> > > > WHERE ContactsGridColumns.displayed=Yes
> > > > ORDER BY ContactsGridColumns.order;

> > > > I'm getting an "No value given for one or more required parameters"
> > error
> > > on
> > > > rsRows.Open (rsRows being an ADO recordset object).

> > > > Okay, I then work the query using access' GUI query designer, then
> view
> > > the
> > > > resulting SQL code.  This is what I see:

> > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > > > ContactsGridColumns.order
> > > > FROM ContactsGridColumns
> > > > WHERE (((ContactsGridColumns.displayed)=True))
> > > > ORDER BY ContactsGridColumns.order;

> > > > Just in case, I added the parens in the WHERE clause to my query
> string,
> > > but
> > > > I still get the same error.  Can someone please help?  I'm obviously
> not
> > > > understanding the Access/VB6/ADO way of doing things and would
> > appreciate
> > > > any help given.

> > > > Thanks!



Tue, 10 May 2005 01:03:33 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
David,

Only last attemp, which I see, is to wrap everything into square brackets

SELECT [columnName] FROM [ContactsGridColumns]

--
Val Mazur
Microsoft MVP



Quote:
> Ok this is the last of the queries that I attempted, and it STILL gave me
> the same darn error:

> SELECT ContactsGridColumns.columnName FROM ContactsGridColumns

> Ok, any help on THIS one?  :-(

> Just in case, I even tried it as:

> SELECT columnName FROM ContactsGridColumns

> Same thing.

> Help, please!!!



> > David,

> > Code looks fine. Try to do next. Remove WHERE condition from your SQL at
> all
> > (just for test purposes) see if it help. If not, then eliminate fields
> from
> > selection list one-by-one to see which one casues it. Let us know

> > --
> > Val Mazur
> > Microsoft MVP



> > > Hi Val, thanks for responding!

> > > Ok, made the changes, but it still died in same manner.  In the
> immediate
> > > window I captured the text of my SQL query (spaced properly for
> displaying
> > > here):

> > > SELECT ContactsGridColumns.columnName,
> > ContactsGridColumns.columnTableName,
> > > [ContactsGridColumns.order], ContactsGridColumns.displayed
> > > FROM ContactsGridColumns
> > > WHERE ContactsGridColumns.displayed=True
> > > ORDER BY [ContactsGridColumns.order];

> > > In case it helps in diagnosing this, here're my ADO calls:

> > > Dim adoConn As ADODB.Connection
> > > Set adoConn = New ADODB.Connection
> > > adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> > > adoConn.ConnectionString = "Data Source=" & m_strProgramPath &
> > > "\Inventory.mdb"
> > > adoConn.Open

> > > Dim rsRows As ADODB.Recordset
> > > Set rsRows = New ADODB.Recordset
> > > rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
> > adCmdText



> > > > David,

> > > > First of all you need to use True or False, but I think problem here
> is
> > > that
> > > > your field has nem "Order". Order is a reserved word and you cannot
> use
> > it
> > > > as a filed/table name directly. Try to wrap it into []

> > > > SELECT ContactsGridColumns.columnDisplayName,
> > > >  ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > > >  [ContactsGridColumns.order]
> > > >  FROM ContactsGridColumns
> > > >  WHERE ContactsGridColumns.displayed=True
> > > >  ORDER BY [ContactsGridColumns.order];

> > > > --
> > > > Val Mazur
> > > > Microsoft MVP



> > > > > Here's a simple query, about as simple as you can get (this is
used
> as
> > > my
> > > > > query string when opening an ADO recordset):

> > > > > SELECT ContactsGridColumns.columnName,
> > > > ContactsGridColumns.columnTableName,
> > > > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > > > FROM ContactsGridColumns
> > > > > WHERE ContactsGridColumns.displayed=Yes
> > > > > ORDER BY ContactsGridColumns.order;

> > > > > I'm getting an "No value given for one or more required
parameters"
> > > error
> > > > on
> > > > > rsRows.Open (rsRows being an ADO recordset object).

> > > > > Okay, I then work the query using access' GUI query designer, then
> > view
> > > > the
> > > > > resulting SQL code.  This is what I see:

> > > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > > ContactsGridColumns.columnTableName,

ContactsGridColumns.displayed,

- Show quoted text -

Quote:
> > > > > ContactsGridColumns.order
> > > > > FROM ContactsGridColumns
> > > > > WHERE (((ContactsGridColumns.displayed)=True))
> > > > > ORDER BY ContactsGridColumns.order;

> > > > > Just in case, I added the parens in the WHERE clause to my query
> > string,
> > > > but
> > > > > I still get the same error.  Can someone please help?  I'm
obviously
> > not
> > > > > understanding the Access/VB6/ADO way of doing things and would
> > > appreciate
> > > > > any help given.

> > > > > Thanks!



Tue, 10 May 2005 01:33:21 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
Just tried.  No luck.  I'm beginning to think that perhaps my whole comp is
screwed up.  There's absolutely no way Access can be that stupidly
non-standard.  Maybe it's time to do the reformat/reinstall thing.


Quote:
> David,

> Only last attemp, which I see, is to wrap everything into square brackets

> SELECT [columnName] FROM [ContactsGridColumns]

> --
> Val Mazur
> Microsoft MVP



> > Ok this is the last of the queries that I attempted, and it STILL gave
me
> > the same darn error:

> > SELECT ContactsGridColumns.columnName FROM ContactsGridColumns

> > Ok, any help on THIS one?  :-(

> > Just in case, I even tried it as:

> > SELECT columnName FROM ContactsGridColumns

> > Same thing.

> > Help, please!!!



> > > David,

> > > Code looks fine. Try to do next. Remove WHERE condition from your SQL
at
> > all
> > > (just for test purposes) see if it help. If not, then eliminate fields
> > from
> > > selection list one-by-one to see which one casues it. Let us know

> > > --
> > > Val Mazur
> > > Microsoft MVP



> > > > Hi Val, thanks for responding!

> > > > Ok, made the changes, but it still died in same manner.  In the
> > immediate
> > > > window I captured the text of my SQL query (spaced properly for
> > displaying
> > > > here):

> > > > SELECT ContactsGridColumns.columnName,
> > > ContactsGridColumns.columnTableName,
> > > > [ContactsGridColumns.order], ContactsGridColumns.displayed
> > > > FROM ContactsGridColumns
> > > > WHERE ContactsGridColumns.displayed=True
> > > > ORDER BY [ContactsGridColumns.order];

> > > > In case it helps in diagnosing this, here're my ADO calls:

> > > > Dim adoConn As ADODB.Connection
> > > > Set adoConn = New ADODB.Connection
> > > > adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> > > > adoConn.ConnectionString = "Data Source=" & m_strProgramPath &
> > > > "\Inventory.mdb"
> > > > adoConn.Open

> > > > Dim rsRows As ADODB.Recordset
> > > > Set rsRows = New ADODB.Recordset
> > > > rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
> > > adCmdText



> > > > > David,

> > > > > First of all you need to use True or False, but I think problem
here
> > is
> > > > that
> > > > > your field has nem "Order". Order is a reserved word and you
cannot
> > use
> > > it
> > > > > as a filed/table name directly. Try to wrap it into []

> > > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > >  ContactsGridColumns.columnTableName,

ContactsGridColumns.displayed,

- Show quoted text -

Quote:
> > > > >  [ContactsGridColumns.order]
> > > > >  FROM ContactsGridColumns
> > > > >  WHERE ContactsGridColumns.displayed=True
> > > > >  ORDER BY [ContactsGridColumns.order];

> > > > > --
> > > > > Val Mazur
> > > > > Microsoft MVP



> > > > > > Here's a simple query, about as simple as you can get (this is
> used
> > as
> > > > my
> > > > > > query string when opening an ADO recordset):

> > > > > > SELECT ContactsGridColumns.columnName,
> > > > > ContactsGridColumns.columnTableName,
> > > > > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > > > > FROM ContactsGridColumns
> > > > > > WHERE ContactsGridColumns.displayed=Yes
> > > > > > ORDER BY ContactsGridColumns.order;

> > > > > > I'm getting an "No value given for one or more required
> parameters"
> > > > error
> > > > > on
> > > > > > rsRows.Open (rsRows being an ADO recordset object).

> > > > > > Okay, I then work the query using access' GUI query designer,
then
> > > view
> > > > > the
> > > > > > resulting SQL code.  This is what I see:

> > > > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > > > ContactsGridColumns.columnTableName,
> ContactsGridColumns.displayed,
> > > > > > ContactsGridColumns.order
> > > > > > FROM ContactsGridColumns
> > > > > > WHERE (((ContactsGridColumns.displayed)=True))
> > > > > > ORDER BY ContactsGridColumns.order;

> > > > > > Just in case, I added the parens in the WHERE clause to my query
> > > string,
> > > > > but
> > > > > > I still get the same error.  Can someone please help?  I'm
> obviously
> > > not
> > > > > > understanding the Access/VB6/ADO way of doing things and would
> > > > appreciate
> > > > > > any help given.

> > > > > > Thanks!



Tue, 10 May 2005 02:01:47 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
David,

Try to compress/repare Access database. Let me know. If it does not help,
then I will try to run same code on my PC, but not earlier than tonight

--
Val Mazur
Microsoft MVP



Quote:
> Just tried.  No luck.  I'm beginning to think that perhaps my whole comp
is
> screwed up.  There's absolutely no way Access can be that stupidly
> non-standard.  Maybe it's time to do the reformat/reinstall thing.



> > David,

> > Only last attemp, which I see, is to wrap everything into square
brackets

> > SELECT [columnName] FROM [ContactsGridColumns]

> > --
> > Val Mazur
> > Microsoft MVP



> > > Ok this is the last of the queries that I attempted, and it STILL gave
> me
> > > the same darn error:

> > > SELECT ContactsGridColumns.columnName FROM ContactsGridColumns

> > > Ok, any help on THIS one?  :-(

> > > Just in case, I even tried it as:

> > > SELECT columnName FROM ContactsGridColumns

> > > Same thing.

> > > Help, please!!!



> > > > David,

> > > > Code looks fine. Try to do next. Remove WHERE condition from your
SQL
> at
> > > all
> > > > (just for test purposes) see if it help. If not, then eliminate
fields
> > > from
> > > > selection list one-by-one to see which one casues it. Let us know

> > > > --
> > > > Val Mazur
> > > > Microsoft MVP



> > > > > Hi Val, thanks for responding!

> > > > > Ok, made the changes, but it still died in same manner.  In the
> > > immediate
> > > > > window I captured the text of my SQL query (spaced properly for
> > > displaying
> > > > > here):

> > > > > SELECT ContactsGridColumns.columnName,
> > > > ContactsGridColumns.columnTableName,
> > > > > [ContactsGridColumns.order], ContactsGridColumns.displayed
> > > > > FROM ContactsGridColumns
> > > > > WHERE ContactsGridColumns.displayed=True
> > > > > ORDER BY [ContactsGridColumns.order];

> > > > > In case it helps in diagnosing this, here're my ADO calls:

> > > > > Dim adoConn As ADODB.Connection
> > > > > Set adoConn = New ADODB.Connection
> > > > > adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> > > > > adoConn.ConnectionString = "Data Source=" & m_strProgramPath &
> > > > > "\Inventory.mdb"
> > > > > adoConn.Open

> > > > > Dim rsRows As ADODB.Recordset
> > > > > Set rsRows = New ADODB.Recordset
> > > > > rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
> > > > adCmdText



> > > > > > David,

> > > > > > First of all you need to use True or False, but I think problem
> here
> > > is
> > > > > that
> > > > > > your field has nem "Order". Order is a reserved word and you
> cannot
> > > use
> > > > it
> > > > > > as a filed/table name directly. Try to wrap it into []

> > > > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > > >  ContactsGridColumns.columnTableName,
> ContactsGridColumns.displayed,
> > > > > >  [ContactsGridColumns.order]
> > > > > >  FROM ContactsGridColumns
> > > > > >  WHERE ContactsGridColumns.displayed=True
> > > > > >  ORDER BY [ContactsGridColumns.order];

> > > > > > --
> > > > > > Val Mazur
> > > > > > Microsoft MVP



> > > > > > > Here's a simple query, about as simple as you can get (this is
> > used
> > > as
> > > > > my
> > > > > > > query string when opening an ADO recordset):

> > > > > > > SELECT ContactsGridColumns.columnName,
> > > > > > ContactsGridColumns.columnTableName,
> > > > > > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > > > > > FROM ContactsGridColumns
> > > > > > > WHERE ContactsGridColumns.displayed=Yes
> > > > > > > ORDER BY ContactsGridColumns.order;

> > > > > > > I'm getting an "No value given for one or more required
> > parameters"
> > > > > error
> > > > > > on
> > > > > > > rsRows.Open (rsRows being an ADO recordset object).

> > > > > > > Okay, I then work the query using access' GUI query designer,
> then
> > > > view
> > > > > > the
> > > > > > > resulting SQL code.  This is what I see:

> > > > > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > > > > ContactsGridColumns.columnTableName,
> > ContactsGridColumns.displayed,
> > > > > > > ContactsGridColumns.order
> > > > > > > FROM ContactsGridColumns
> > > > > > > WHERE (((ContactsGridColumns.displayed)=True))
> > > > > > > ORDER BY ContactsGridColumns.order;

> > > > > > > Just in case, I added the parens in the WHERE clause to my
query
> > > > string,
> > > > > > but
> > > > > > > I still get the same error.  Can someone please help?  I'm
> > obviously
> > > > not
> > > > > > > understanding the Access/VB6/ADO way of doing things and would
> > > > > appreciate
> > > > > > > any help given.

> > > > > > > Thanks!



Tue, 10 May 2005 02:27:51 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
David
Apparently, your sql  statement should work, it does on my machine
(Access2K/Win ME)
Maybe the problem may lie elsewhere
Could you post the code for creating the ADO's recordset and connection
objects ?

Sukesh



Quote:
> Here's a simple query, about as simple as you can get (this is used as my
> query string when opening an ADO recordset):

> SELECT ContactsGridColumns.columnName,

ContactsGridColumns.columnTableName,
Quote:
> ContactsGridColumns.order, ContactsGridColumns.displayed
> FROM ContactsGridColumns
> WHERE ContactsGridColumns.displayed=Yes
> ORDER BY ContactsGridColumns.order;

> I'm getting an "No value given for one or more required parameters" error
on
> rsRows.Open (rsRows being an ADO recordset object).

> Okay, I then work the query using access' GUI query designer, then view
the
> resulting SQL code.  This is what I see:

> SELECT ContactsGridColumns.columnDisplayName,
> ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> ContactsGridColumns.order
> FROM ContactsGridColumns
> WHERE (((ContactsGridColumns.displayed)=True))
> ORDER BY ContactsGridColumns.order;

> Just in case, I added the parens in the WHERE clause to my query string,
but
> I still get the same error.  Can someone please help?  I'm obviously not
> understanding the Access/VB6/ADO way of doing things and would appreciate
> any help given.

> Thanks!



Tue, 10 May 2005 02:56:35 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
Ok here's the full code, hope it helps...

' In a module, modDatabaseHelpers
' No error checking code in place as of yet in project.
Public Sub GetADOConnection(ByRef adoConn As ADODB.Connection)
    Set adoConn = New ADODB.Connection

    adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
    adoConn.ConnectionString = "Data Source=" & App.Path & "\Inventory.mdb"
    adoConn.Open
End Sub

' In my form
Private Sub SetGridContents()
    Dim adoConn As ADODB.Connection
    GetADOConnection adoConn

    Dim strQuery As String
    strQuery = "SELECT [columnName] FROM [ContactsGridColumns] "
    Dim rsRows As ADODB.Recordset
    Set rsRows = New ADODB.Recordset

   ' The following statement dies with an error box containing:
   ' 'Run-time error '-2147217904 (80040e10)':
   ' No value given for one or more required parameters.
    rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
adCmdText
...

Val, I did the compress/repair database, still same results.

Any ideas?


Quote:
> David
> Apparently, your sql  statement should work, it does on my machine
> (Access2K/Win ME)
> Maybe the problem may lie elsewhere
> Could you post the code for creating the ADO's recordset and connection
> objects ?

> Sukesh



> > Here's a simple query, about as simple as you can get (this is used as
my
> > query string when opening an ADO recordset):

> > SELECT ContactsGridColumns.columnName,
> ContactsGridColumns.columnTableName,
> > ContactsGridColumns.order, ContactsGridColumns.displayed
> > FROM ContactsGridColumns
> > WHERE ContactsGridColumns.displayed=Yes
> > ORDER BY ContactsGridColumns.order;

> > I'm getting an "No value given for one or more required parameters"
error
> on
> > rsRows.Open (rsRows being an ADO recordset object).

> > Okay, I then work the query using access' GUI query designer, then view
> the
> > resulting SQL code.  This is what I see:

> > SELECT ContactsGridColumns.columnDisplayName,
> > ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > ContactsGridColumns.order
> > FROM ContactsGridColumns
> > WHERE (((ContactsGridColumns.displayed)=True))
> > ORDER BY ContactsGridColumns.order;

> > Just in case, I added the parens in the WHERE clause to my query string,
> but
> > I still get the same error.  Can someone please help?  I'm obviously not
> > understanding the Access/VB6/ADO way of doing things and would
appreciate
> > any help given.

> > Thanks!



Tue, 10 May 2005 03:47:45 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
This is probably just bad day. Code looks fine as well. Check if your
Connection is opened after you call GetADOConnection sub

--
Val Mazur
Microsoft MVP



Quote:
> Ok here's the full code, hope it helps...

> ' In a module, modDatabaseHelpers
> ' No error checking code in place as of yet in project.
> Public Sub GetADOConnection(ByRef adoConn As ADODB.Connection)
>     Set adoConn = New ADODB.Connection

>     adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
>     adoConn.ConnectionString = "Data Source=" & App.Path &
"\Inventory.mdb"
>     adoConn.Open
> End Sub

> ' In my form
> Private Sub SetGridContents()
>     Dim adoConn As ADODB.Connection
>     GetADOConnection adoConn

>     Dim strQuery As String
>     strQuery = "SELECT [columnName] FROM [ContactsGridColumns] "
>     Dim rsRows As ADODB.Recordset
>     Set rsRows = New ADODB.Recordset

>    ' The following statement dies with an error box containing:
>    ' 'Run-time error '-2147217904 (80040e10)':
>    ' No value given for one or more required parameters.
>     rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
> adCmdText
> ...

> Val, I did the compress/repair database, still same results.

> Any ideas?



> > David
> > Apparently, your sql  statement should work, it does on my machine
> > (Access2K/Win ME)
> > Maybe the problem may lie elsewhere
> > Could you post the code for creating the ADO's recordset and connection
> > objects ?

> > Sukesh



> > > Here's a simple query, about as simple as you can get (this is used as
> my
> > > query string when opening an ADO recordset):

> > > SELECT ContactsGridColumns.columnName,
> > ContactsGridColumns.columnTableName,
> > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > FROM ContactsGridColumns
> > > WHERE ContactsGridColumns.displayed=Yes
> > > ORDER BY ContactsGridColumns.order;

> > > I'm getting an "No value given for one or more required parameters"
> error
> > on
> > > rsRows.Open (rsRows being an ADO recordset object).

> > > Okay, I then work the query using access' GUI query designer, then
view
> > the
> > > resulting SQL code.  This is what I see:

> > > SELECT ContactsGridColumns.columnDisplayName,
> > > ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > > ContactsGridColumns.order
> > > FROM ContactsGridColumns
> > > WHERE (((ContactsGridColumns.displayed)=True))
> > > ORDER BY ContactsGridColumns.order;

> > > Just in case, I added the parens in the WHERE clause to my query
string,
> > but
> > > I still get the same error.  Can someone please help?  I'm obviously
not
> > > understanding the Access/VB6/ADO way of doing things and would
> appreciate
> > > any help given.

> > > Thanks!



Tue, 10 May 2005 04:02:46 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
Yeah, I'd checked for a status of open after opening my ADO connection
object, no problems there.  Looks like something might be hosed up on my
machine, if the code I provided works fine (and why wouldn't it?!) on
others' machines.  Sigh.

Thanks for trying, guys!


Quote:
> This is probably just bad day. Code looks fine as well. Check if your
> Connection is opened after you call GetADOConnection sub

> --
> Val Mazur
> Microsoft MVP



> > Ok here's the full code, hope it helps...

> > ' In a module, modDatabaseHelpers
> > ' No error checking code in place as of yet in project.
> > Public Sub GetADOConnection(ByRef adoConn As ADODB.Connection)
> >     Set adoConn = New ADODB.Connection

> >     adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> >     adoConn.ConnectionString = "Data Source=" & App.Path &
> "\Inventory.mdb"
> >     adoConn.Open
> > End Sub

> > ' In my form
> > Private Sub SetGridContents()
> >     Dim adoConn As ADODB.Connection
> >     GetADOConnection adoConn

> >     Dim strQuery As String
> >     strQuery = "SELECT [columnName] FROM [ContactsGridColumns] "
> >     Dim rsRows As ADODB.Recordset
> >     Set rsRows = New ADODB.Recordset

> >    ' The following statement dies with an error box containing:
> >    ' 'Run-time error '-2147217904 (80040e10)':
> >    ' No value given for one or more required parameters.
> >     rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
> > adCmdText
> > ...

> > Val, I did the compress/repair database, still same results.

> > Any ideas?



> > > David
> > > Apparently, your sql  statement should work, it does on my machine
> > > (Access2K/Win ME)
> > > Maybe the problem may lie elsewhere
> > > Could you post the code for creating the ADO's recordset and
connection
> > > objects ?

> > > Sukesh



> > > > Here's a simple query, about as simple as you can get (this is used
as
> > my
> > > > query string when opening an ADO recordset):

> > > > SELECT ContactsGridColumns.columnName,
> > > ContactsGridColumns.columnTableName,
> > > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > > FROM ContactsGridColumns
> > > > WHERE ContactsGridColumns.displayed=Yes
> > > > ORDER BY ContactsGridColumns.order;

> > > > I'm getting an "No value given for one or more required parameters"
> > error
> > > on
> > > > rsRows.Open (rsRows being an ADO recordset object).

> > > > Okay, I then work the query using access' GUI query designer, then
> view
> > > the
> > > > resulting SQL code.  This is what I see:

> > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > ContactsGridColumns.columnTableName, ContactsGridColumns.displayed,
> > > > ContactsGridColumns.order
> > > > FROM ContactsGridColumns
> > > > WHERE (((ContactsGridColumns.displayed)=True))
> > > > ORDER BY ContactsGridColumns.order;

> > > > Just in case, I added the parens in the WHERE clause to my query
> string,
> > > but
> > > > I still get the same error.  Can someone please help?  I'm obviously
> not
> > > > understanding the Access/VB6/ADO way of doing things and would
> > appreciate
> > > > any help given.

> > > > Thanks!



Tue, 10 May 2005 06:23:13 GMT  
 Having problems with SIMPLE query in VB 6 and Access XP, Please Help
David,

Try to run Component Checker from MDAC see if there is no corruption in MDAC
installation

--
Val Mazur
Microsoft MVP



Quote:
> Yeah, I'd checked for a status of open after opening my ADO connection
> object, no problems there.  Looks like something might be hosed up on my
> machine, if the code I provided works fine (and why wouldn't it?!) on
> others' machines.  Sigh.

> Thanks for trying, guys!



> > This is probably just bad day. Code looks fine as well. Check if your
> > Connection is opened after you call GetADOConnection sub

> > --
> > Val Mazur
> > Microsoft MVP



> > > Ok here's the full code, hope it helps...

> > > ' In a module, modDatabaseHelpers
> > > ' No error checking code in place as of yet in project.
> > > Public Sub GetADOConnection(ByRef adoConn As ADODB.Connection)
> > >     Set adoConn = New ADODB.Connection

> > >     adoConn.Provider = "Microsoft.Jet.OLEDB.4.0"
> > >     adoConn.ConnectionString = "Data Source=" & App.Path &
> > "\Inventory.mdb"
> > >     adoConn.Open
> > > End Sub

> > > ' In my form
> > > Private Sub SetGridContents()
> > >     Dim adoConn As ADODB.Connection
> > >     GetADOConnection adoConn

> > >     Dim strQuery As String
> > >     strQuery = "SELECT [columnName] FROM [ContactsGridColumns] "
> > >     Dim rsRows As ADODB.Recordset
> > >     Set rsRows = New ADODB.Recordset

> > >    ' The following statement dies with an error box containing:
> > >    ' 'Run-time error '-2147217904 (80040e10)':
> > >    ' No value given for one or more required parameters.
> > >     rsRows.Open strQuery, adoConn, adOpenForwardOnly, adLockReadOnly,
> > > adCmdText
> > > ...

> > > Val, I did the compress/repair database, still same results.

> > > Any ideas?



> > > > David
> > > > Apparently, your sql  statement should work, it does on my machine
> > > > (Access2K/Win ME)
> > > > Maybe the problem may lie elsewhere
> > > > Could you post the code for creating the ADO's recordset and
> connection
> > > > objects ?

> > > > Sukesh



> > > > > Here's a simple query, about as simple as you can get (this is
used
> as
> > > my
> > > > > query string when opening an ADO recordset):

> > > > > SELECT ContactsGridColumns.columnName,
> > > > ContactsGridColumns.columnTableName,
> > > > > ContactsGridColumns.order, ContactsGridColumns.displayed
> > > > > FROM ContactsGridColumns
> > > > > WHERE ContactsGridColumns.displayed=Yes
> > > > > ORDER BY ContactsGridColumns.order;

> > > > > I'm getting an "No value given for one or more required
parameters"
> > > error
> > > > on
> > > > > rsRows.Open (rsRows being an ADO recordset object).

> > > > > Okay, I then work the query using access' GUI query designer, then
> > view
> > > > the
> > > > > resulting SQL code.  This is what I see:

> > > > > SELECT ContactsGridColumns.columnDisplayName,
> > > > > ContactsGridColumns.columnTableName,

ContactsGridColumns.displayed,

- Show quoted text -

Quote:
> > > > > ContactsGridColumns.order
> > > > > FROM ContactsGridColumns
> > > > > WHERE (((ContactsGridColumns.displayed)=True))
> > > > > ORDER BY ContactsGridColumns.order;

> > > > > Just in case, I added the parens in the WHERE clause to my query
> > string,
> > > > but
> > > > > I still get the same error.  Can someone please help?  I'm
obviously
> > not
> > > > > understanding the Access/VB6/ADO way of doing things and would
> > > appreciate
> > > > > any help given.

> > > > > Thanks!



Tue, 10 May 2005 09:26:55 GMT  
 
 [ 16 post ]  Go to page: [1] [2]

 Relevant Pages 

1. I'm having problems querying access database

2. Newbiw having problems with Permanent QueryDef: Query input must contain at least one table or query

3. VB and Access query PLEASE HELP

4. Having problem with Common Dialog Font Dialog - Please Help

5. VB and Access query PLEASE HELP

6. Having problems with Fields, please help.

7. Having Problem with Loadimage need help please

8. Need help on simple SQL query please!

9. Help with simple SQL query please!

10. Help with Simple SQL query please?

11. Help with simple SQL query please?

12. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

 

 
Powered by phpBB® Forum Software