Problems with ado 2.1 module 
Author Message
 Problems with ado 2.1 module

    I am Programming in VBA in Access 2000. I am using ado module 2.1. Well
I am having problems open a recordset. The funny thing is that I opened the
recordset many times before in access 2000 but this is just acting really
weird. Right when it hits the line saying it  (((((Dies Right here and goes
crazy))  It gives me a error saying No value given for one or more required
parameters Runtime error '-2147217904 (80040e10). I have used the same code
to open different recordsets and it worked fine. If anyone can help out I
would appreciate your help.. Thanks

Private Sub sqlResults()
Dim rsRecord As ADODB.Recordset
Dim rsResult As ADODB.Recordset
Dim rsDevi As ADODB.Recordset
Dim strSQL As String
Dim strDev As String
Dim conDatabase As ADODB.Connection

strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _





& _

& _

_

_

_

"
& _

 " FROM tbl_LiqDetergent " & _
 "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value & "') "
& _
 "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
 "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

Set rsDevi = New ADODB.Recordset 'Establishies new Record set
  rsDevi.CursorType = adOpenKeyset 'Sets up
  rsDevi.LockType = adLockOptimistic
  rsDevi.CursorLocation = adUseClient
rsDevi.Open strDev, conDatabase 'Opens the record set <--(((((Dies Right
here and goes crazy))
 If rsDevi.EOF = True Then 'If nothing exist then quits
   MsgBox "Error no record exists", vbCritical, "Error"
   Exit Sub
 End If



Fri, 18 Feb 2005 07:21:01 GMT  
 Problems with ado 2.1 module
The required parameter that is missing is the ActiveConnection property of
the recordset. You have declared a Connection object, but you have not
assigned anything to it, nor assigned it to the ActiveConnection property of
the recordset.

If you need further help on assigning the connection, it would be useful to
know whether this is an MDB or an ADP, and whether the table is local or
linked.

--
Brendan Reynolds (MVP)

Access 2000/2002 sample app at
http://brenreyn.brinkster.net
----------------------------

Quote:
>     I am Programming in vba in Access 2000. I am using ado module 2.1.
Well
> I am having problems open a recordset. The funny thing is that I opened
the
> recordset many times before in access 2000 but this is just acting really
> weird. Right when it hits the line saying it  (((((Dies Right here and
goes
> crazy))  It gives me a error saying No value given for one or more
required
> parameters Runtime error '-2147217904 (80040e10). I have used the same
code
> to open different recordsets and it worked fine. If anyone can help out I
> would appreciate your help.. Thanks

> Private Sub sqlResults()
> Dim rsRecord As ADODB.Recordset
> Dim rsResult As ADODB.Recordset
> Dim rsDevi As ADODB.Recordset
> Dim strSQL As String
> Dim strDev As String
> Dim conDatabase As ADODB.Connection

> strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _




_


1735],[38C80RH_1570],"
Quote:
> & _

"
> & _

&
> _

&
> _

&
> _

"

- Show quoted text -

Quote:
> & _

>  " FROM tbl_LiqDetergent " & _
>  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value & "')
"
> & _
>  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
>  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> Set rsDevi = New ADODB.Recordset 'Establishies new Record set
>   rsDevi.CursorType = adOpenKeyset 'Sets up
>   rsDevi.LockType = adLockOptimistic
>   rsDevi.CursorLocation = adUseClient
> rsDevi.Open strDev, conDatabase 'Opens the record set <--(((((Dies Right
> here and goes crazy))
>  If rsDevi.EOF = True Then 'If nothing exist then quits
>    MsgBox "Error no record exists", vbCritical, "Error"
>    Exit Sub
>  End If



Fri, 18 Feb 2005 17:55:29 GMT  
 Problems with ado 2.1 module
 Hello this is a mdb file that I am working on . I accidenly left this line
out when I posted the first topic. So I am setting to the current project
but it's still giving that error.. Thanks for the help
Set conDatabase = CurrentProject.Connection 'Sets the connection to the


Quote:
> The required parameter that is missing is the ActiveConnection property of
> the recordset. You have declared a Connection object, but you have not
> assigned anything to it, nor assigned it to the ActiveConnection property
of
> the recordset.

> If you need further help on assigning the connection, it would be useful
to
> know whether this is an MDB or an ADP, and whether the table is local or
> linked.

> --
> Brendan Reynolds (MVP)

> Access 2000/2002 sample app at
> http://brenreyn.brinkster.net
> ----------------------------


> >     I am Programming in vba in Access 2000. I am using ado module 2.1.
> Well
> > I am having problems open a recordset. The funny thing is that I opened
> the
> > recordset many times before in access 2000 but this is just acting
really
> > weird. Right when it hits the line saying it  (((((Dies Right here and
> goes
> > crazy))  It gives me a error saying No value given for one or more
> required
> > parameters Runtime error '-2147217904 (80040e10). I have used the same
> code
> > to open different recordsets and it worked fine. If anyone can help out
I
> > would appreciate your help.. Thanks

> > Private Sub sqlResults()
> > Dim rsRecord As ADODB.Recordset
> > Dim rsResult As ADODB.Recordset
> > Dim rsDevi As ADODB.Recordset
> > Dim strSQL As String
> > Dim strDev As String
> > Dim conDatabase As ADODB.Connection

> > strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _




&
> _

> 1735],[38C80RH_1570],"
> > & _

[38C80RH_1654],
> "
> > & _

"
> &
> > _
> >  "[38C10RH_1735]


Quote:
> &
> > _


Quote:
> &
> > _

"

- Show quoted text -

Quote:
> > & _

> >  " FROM tbl_LiqDetergent " & _
> >  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value &
"')
> "
> > & _
> >  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
> >  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> > Set rsDevi = New ADODB.Recordset 'Establishies new Record set
> >   rsDevi.CursorType = adOpenKeyset 'Sets up
> >   rsDevi.LockType = adLockOptimistic
> >   rsDevi.CursorLocation = adUseClient
> > rsDevi.Open strDev, conDatabase 'Opens the record set <--(((((Dies Right
> > here and goes crazy))
> >  If rsDevi.EOF = True Then 'If nothing exist then quits
> >    MsgBox "Error no record exists", vbCritical, "Error"
> >    Exit Sub
> >  End If



Sat, 19 Feb 2005 02:03:42 GMT  
 Problems with ado 2.1 module
Hi Eric,

Not all cursor types are supported with all cursor locations. According to
the help topic on the CursorType property:

"Only a setting of adOpenStatic is supported if the CursorLocation property
is set to adUseClient. If an unsupported value is set, then no error will
result; the closest supported CursorType will be used instead."

Possibly the fact that you're getting a cursor type other than the one you
requested might be the cause of the problem. Try either changing the
CursorLocation to adUserServer, or changing the CursorType to adOpenStatic.

--
Brendan Reynolds (MVP)

Access 2000/2002 sample app at
http://brenreyn.brinkster.net
----------------------------

Quote:
> Hello this is a mdb file that I am working on . I accidenly left this line
> out when I posted the first topic. So I am setting to the current project
> but it's still giving that error.. Thanks for the help
> Set conDatabase = CurrentProject.Connection 'Sets the connection to the



> > The required parameter that is missing is the ActiveConnection property
of
> > the recordset. You have declared a Connection object, but you have not
> > assigned anything to it, nor assigned it to the ActiveConnection
property
> of
> > the recordset.

> > If you need further help on assigning the connection, it would be useful
> to
> > know whether this is an MDB or an ADP, and whether the table is local or
> > linked.

> > --
> > Brendan Reynolds (MVP)

> > Access 2000/2002 sample app at
> > http://brenreyn.brinkster.net
> > ----------------------------


> > >     I am Programming in vba in Access 2000. I am using ado module 2.1.
> > Well
> > > I am having problems open a recordset. The funny thing is that I
opened
> > the
> > > recordset many times before in access 2000 but this is just acting
> really
> > > weird. Right when it hits the line saying it  (((((Dies Right here and
> > goes
> > > crazy))  It gives me a error saying No value given for one or more
> > required
> > > parameters Runtime error '-2147217904 (80040e10). I have used the same
> > code
> > > to open different recordsets and it worked fine. If anyone can help
out
> I
> > > would appreciate your help.. Thanks

> > > Private Sub sqlResults()
> > > Dim rsRecord As ADODB.Recordset
> > > Dim rsResult As ADODB.Recordset
> > > Dim rsDevi As ADODB.Recordset
> > > Dim strSQL As String
> > > Dim strDev As String
> > > Dim conDatabase As ADODB.Connection

> > > strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _




Ambient_1161,"
> &
> > _

> > 1735],[38C80RH_1570],"
> > > & _

> [38C80RH_1654],
> > "
> > > & _


Quote:
> "
> > &
> > > _
> > >  "[38C10RH_1735]

> > &
> > > _


> > &
> > > _

"

- Show quoted text -

Quote:
> > > & _

> > >  " FROM tbl_LiqDetergent " & _
> > >  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value &
> "')
> > "
> > > & _
> > >  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " &
_
> > >  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> > > Set rsDevi = New ADODB.Recordset 'Establishies new Record set
> > >   rsDevi.CursorType = adOpenKeyset 'Sets up
> > >   rsDevi.LockType = adLockOptimistic
> > >   rsDevi.CursorLocation = adUseClient
> > > rsDevi.Open strDev, conDatabase 'Opens the record set <--(((((Dies
Right
> > > here and goes crazy))
> > >  If rsDevi.EOF = True Then 'If nothing exist then quits
> > >    MsgBox "Error no record exists", vbCritical, "Error"
> > >    Exit Sub
> > >  End If



Sat, 19 Feb 2005 03:08:48 GMT  
 Problems with ado 2.1 module
 I changed the cursortype to adopenstatic still get the same error. I
changed the cursorlocation to aduserserver still get the same error not sure
why it's giving me that error. I am using almost the same code in another
sub and it works fine. Thanks for the help


Quote:
> Hi Eric,

> Not all cursor types are supported with all cursor locations. According to
> the help topic on the CursorType property:

> "Only a setting of adOpenStatic is supported if the CursorLocation
property
> is set to adUseClient. If an unsupported value is set, then no error will
> result; the closest supported CursorType will be used instead."

> Possibly the fact that you're getting a cursor type other than the one you
> requested might be the cause of the problem. Try either changing the
> CursorLocation to adUserServer, or changing the CursorType to
adOpenStatic.

> --
> Brendan Reynolds (MVP)

> Access 2000/2002 sample app at
> http://brenreyn.brinkster.net
> ----------------------------


> > Hello this is a mdb file that I am working on . I accidenly left this
line
> > out when I posted the first topic. So I am setting to the current
project
> > but it's still giving that error.. Thanks for the help
> > Set conDatabase = CurrentProject.Connection 'Sets the connection to the



> > > The required parameter that is missing is the ActiveConnection
property
> of
> > > the recordset. You have declared a Connection object, but you have not
> > > assigned anything to it, nor assigned it to the ActiveConnection
> property
> > of
> > > the recordset.

> > > If you need further help on assigning the connection, it would be
useful
> > to
> > > know whether this is an MDB or an ADP, and whether the table is local
or
> > > linked.

> > > --
> > > Brendan Reynolds (MVP)

> > > Access 2000/2002 sample app at
> > > http://brenreyn.brinkster.net
> > > ----------------------------


> > > >     I am Programming in vba in Access 2000. I am using ado module
2.1.
> > > Well
> > > > I am having problems open a recordset. The funny thing is that I
> opened
> > > the
> > > > recordset many times before in access 2000 but this is just acting
> > really
> > > > weird. Right when it hits the line saying it  (((((Dies Right here
and
> > > goes
> > > > crazy))  It gives me a error saying No value given for one or more
> > > required
> > > > parameters Runtime error '-2147217904 (80040e10). I have used the
same
> > > code
> > > > to open different recordsets and it worked fine. If anyone can help
> out
> > I
> > > > would appreciate your help.. Thanks

> > > > Private Sub sqlResults()
> > > > Dim rsRecord As ADODB.Recordset
> > > > Dim rsResult As ADODB.Recordset
> > > > Dim rsDevi As ADODB.Recordset
> > > > Dim strSQL As String
> > > > Dim strDev As String
> > > > Dim conDatabase As ADODB.Connection

> > > > strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _

_


_

> Ambient_1161,"
> > &
> > > _

> > > 1735],[38C80RH_1570],"
> > > > & _

> > [38C80RH_1654],
> > > "
> > > > & _


> > "
> > > &
> > > > _
> > > >  "[38C10RH_1735]

> > > &
> > > > _


> > > &
> > > > _

"

- Show quoted text -

Quote:
> > > > & _

_
> > > >  " FROM tbl_LiqDetergent " & _
> > > >  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value
&
> > "')
> > > "
> > > > & _
> > > >  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') "
&
> _
> > > >  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> > > > Set rsDevi = New ADODB.Recordset 'Establishies new Record set
> > > >   rsDevi.CursorType = adOpenKeyset 'Sets up
> > > >   rsDevi.LockType = adLockOptimistic
> > > >   rsDevi.CursorLocation = adUseClient
> > > > rsDevi.Open strDev, conDatabase 'Opens the record set <--(((((Dies
> Right
> > > > here and goes crazy))
> > > >  If rsDevi.EOF = True Then 'If nothing exist then quits
> > > >    MsgBox "Error no record exists", vbCritical, "Error"
> > > >    Exit Sub
> > > >  End If



Sat, 19 Feb 2005 04:05:35 GMT  
 Problems with ado 2.1 module
There are two possible sources for the error here, I think - an error in the
code, or an error in the SQL statement. What if you try the same code with a
simpler SQL statement, something like "SELECT * FROM tbl_LiqDetergent". If
you still get the error, we'll know the error is in the code. If you don't
get the error, then we may need to look at the SQL statement instead.

--
Brendan Reynolds (MVP)

Access 2000/2002 sample app at
http://brenreyn.brinkster.net
----------------------------

Quote:
> I changed the cursortype to adopenstatic still get the same error. I
> changed the cursorlocation to aduserserver still get the same error not
sure
> why it's giving me that error. I am using almost the same code in another
> sub and it works fine. Thanks for the help



> > Hi Eric,

> > Not all cursor types are supported with all cursor locations. According
to
> > the help topic on the CursorType property:

> > "Only a setting of adOpenStatic is supported if the CursorLocation
> property
> > is set to adUseClient. If an unsupported value is set, then no error
will
> > result; the closest supported CursorType will be used instead."

> > Possibly the fact that you're getting a cursor type other than the one
you
> > requested might be the cause of the problem. Try either changing the
> > CursorLocation to adUserServer, or changing the CursorType to
> adOpenStatic.

> > --
> > Brendan Reynolds (MVP)

> > Access 2000/2002 sample app at
> > http://brenreyn.brinkster.net
> > ----------------------------


> > > Hello this is a mdb file that I am working on . I accidenly left this
> line
> > > out when I posted the first topic. So I am setting to the current
> project
> > > but it's still giving that error.. Thanks for the help
> > > Set conDatabase = CurrentProject.Connection 'Sets the connection to
the



> > > > The required parameter that is missing is the ActiveConnection
> property
> > of
> > > > the recordset. You have declared a Connection object, but you have
not
> > > > assigned anything to it, nor assigned it to the ActiveConnection
> > property
> > > of
> > > > the recordset.

> > > > If you need further help on assigning the connection, it would be
> useful
> > > to
> > > > know whether this is an MDB or an ADP, and whether the table is
local
> or
> > > > linked.

> > > > --
> > > > Brendan Reynolds (MVP)

> > > > Access 2000/2002 sample app at
> > > > http://brenreyn.brinkster.net
> > > > ----------------------------


> > > > >     I am Programming in vba in Access 2000. I am using ado module
> 2.1.
> > > > Well
> > > > > I am having problems open a recordset. The funny thing is that I
> > opened
> > > > the
> > > > > recordset many times before in access 2000 but this is just acting
> > > really
> > > > > weird. Right when it hits the line saying it  (((((Dies Right here
> and
> > > > goes
> > > > > crazy))  It gives me a error saying No value given for one or more
> > > > required
> > > > > parameters Runtime error '-2147217904 (80040e10). I have used the
> same
> > > > code
> > > > > to open different recordsets and it worked fine. If anyone can
help
> > out
> > > I
> > > > > would appreciate your help.. Thanks

> > > > > Private Sub sqlResults()
> > > > > Dim rsRecord As ADODB.Recordset
> > > > > Dim rsResult As ADODB.Recordset
> > > > > Dim rsDevi As ADODB.Recordset
> > > > > Dim strSQL As String
> > > > > Dim strDev As String
> > > > > Dim conDatabase As ADODB.Connection

> > > > > strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _

&
> _


&
> _

> > Ambient_1161,"
> > > &
> > > > _

> > > > 1735],[38C80RH_1570],"
> > > > > & _

> > > [38C80RH_1654],
> > > > "
> > > > > & _


> > > "
> > > > &
> > > > > _
> > > > >  "[38C10RH_1735]

> > > > &
> > > > > _


Quote:
> > > > &
> > > > > _

"
Quote:
> > > > > & _

&
> _
> > > > >  " FROM tbl_LiqDetergent " & _
> > > > >  "WHERE (((tbl_LiqDetergent.ProductCode) = '" &

cboproductCode.Value

- Show quoted text -

Quote:
> &
> > > "')
> > > > "
> > > > > & _
> > > > >  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "')
"
> &
> > _
> > > > >  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> > > > > Set rsDevi = New ADODB.Recordset 'Establishies new Record set
> > > > >   rsDevi.CursorType = adOpenKeyset 'Sets up
> > > > >   rsDevi.LockType = adLockOptimistic
> > > > >   rsDevi.CursorLocation = adUseClient
> > > > > rsDevi.Open strDev, conDatabase 'Opens the record set <--(((((Dies
> > Right
> > > > > here and goes crazy))
> > > > >  If rsDevi.EOF = True Then 'If nothing exist then quits
> > > > >    MsgBox "Error no record exists", vbCritical, "Error"
> > > > >    Exit Sub
> > > > >  End If



Sat, 19 Feb 2005 04:21:08 GMT  
 Problems with ado 2.1 module
 Ok I did select * and it worked.. I can't believe it didn't give me a
syntax error. Well below one select statment works and the other doesn't I
don't see a flaw maybe you can see it .. Thanks for the help ..

This is the one that doesn't work
strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _





& _

& _

_

_

_

"
& _

 " FROM tbl_LiqDetergent " & _
 "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value & "')"
& _
 "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
 "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

This select statement works. I call this select statement before the one
above.

strSQL = "SELECT avg(Unexposed_1735),avg(Unexposed_1570), " & _



_

avg(Ambient_1096)," & _

avg(Ambient_1161)," & _

avg([38C80RH_1735]),avg([38C80RH_1570])," & _

avg([38C80RH_1654]), " & _

[
38C10RH_1570]), " & _
 "avg([38C10RH_1735])

1

)


 " FROM tbl_LiqDetergent " & _
 "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value & "')"
& _
 "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
 "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "



Sat, 19 Feb 2005 13:39:56 GMT  
 Problems with ado 2.1 module
Got it! It's too many line-continuations. There's a max of ten. Try
something like this:

strDev = "SELECT Field1, Field2, " & _
    "Field3, Field4, " & _

etc., up to 10 line continuations. Then ...

strDev = strDev & "Fielda, FieldB, " & _
    "Fieldc, Field, " & _

--
Brendan Reynolds (MVP)

Access 2000/2002 sample app at
http://brenreyn.brinkster.net
----------------------------

Quote:
> Ok I did select * and it worked.. I can't believe it didn't give me a
> syntax error. Well below one select statment works and the other doesn't I
> don't see a flaw maybe you can see it .. Thanks for the help ..

> This is the one that doesn't work
> strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _




_


1735],[38C80RH_1570],"
Quote:
> & _

"
> & _

&
> _

&
> _

&
> _

"
Quote:
> & _

>  " FROM tbl_LiqDetergent " & _
>  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value &
"')"
> & _
>  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
>  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> This select statement works. I call this select statement before the one
> above.

> strSQL = "SELECT avg(Unexposed_1735),avg(Unexposed_1570), " & _



&
> _

> avg(Ambient_1096)," & _

> avg(Ambient_1161)," & _

> avg([38C80RH_1735]),avg([38C80RH_1570])," & _

> avg([38C80RH_1654]), " & _

[
Quote:
> 38C10RH_1570]), " & _
>  "avg([38C10RH_1735])

_

1
)
s

- Show quoted text -

Quote:

>  " FROM tbl_LiqDetergent " & _
>  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value &
"')"
> & _
>  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
>  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "



Sat, 19 Feb 2005 18:21:28 GMT  
 Problems with ado 2.1 module
Well I redid the statement so it used less & _ and it still giving me the
same problem. Here is what it looks like.. Thanks for the help
strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _



Ambient_1096," & _


1735],[38C80RH_1570]," & _

0
RH_1570], " & _
 "[38C10RH_1735]
1

N

 " FROM tbl_LiqDetergent WHERE (((tbl_LiqDetergent.ProductCode) = '" &
cboproductCode.Value & "') " & _
 "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') And
((tbl_LiqDetergent.day) = '" & day.Value & "')) "

Quote:
> This is the one that doesn't work
> strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _




_


1735],[38C80RH_1570],"
Quote:
> & _

"
> & _

&
> _

&
> _

&
> _

"
Quote:
> & _

>  " FROM tbl_LiqDetergent " & _
>  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value &
"')"
> & _
>  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
>  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> This select statement works. I call this select statement before the one
> above.

> strSQL = "SELECT avg(Unexposed_1735),avg(Unexposed_1570), " & _



&
> _

> avg(Ambient_1096)," & _

> avg(Ambient_1161)," & _

> avg([38C80RH_1735]),avg([38C80RH_1570])," & _

> avg([38C80RH_1654]), " & _

[
Quote:
> 38C10RH_1570]), " & _
>  "avg([38C10RH_1735])

_

1
)
s

- Show quoted text -

Quote:

>  " FROM tbl_LiqDetergent " & _
>  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value &
"')"
> & _
>  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
>  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "



Sat, 19 Feb 2005 23:05:08 GMT  
 Problems with ado 2.1 module
OK, let's see if we can narrow it down a bit further. Does it work with just
the SELECT and FROM clauses, leaving out the WHERE clause? If it does, we'll
have narrowed the problem down to the WHERE clause. If it still doesn't
work, then we'll know that the problem lies outside the WHERE clause -
probably in the SELECT clause, because the FROM clause is just a single
table name. The next thing to try then would be to use a subset of the
SELECT clause - does it work with just the first 3 or 4 lines? If no, the
problem is in those lines, if yes, it's in the other lines. That way you
should be able to narrow it down to a single line, and then a single field.

--
Brendan Reynolds (MVP)

Access 2000/2002 sample app at
http://brenreyn.brinkster.net
----------------------------

Quote:
> Well I redid the statement so it used less & _ and it still giving me the
> same problem. Here is what it looks like.. Thanks for the help
> strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _



> Ambient_1096," & _


> 1735],[38C80RH_1570]," & _


0
Quote:
> RH_1570], " & _
>  "[38C10RH_1735]

1
N
Quote:

>  " FROM tbl_LiqDetergent WHERE (((tbl_LiqDetergent.ProductCode) = '" &
> cboproductCode.Value & "') " & _
>  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') And
> ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> > This is the one that doesn't work
> > strDev = "SELECT Unexposed_1735,Unexposed_1570, " & _




&
> _

> 1735],[38C80RH_1570],"
> > & _

[38C80RH_1654],
> "
> > & _

"
> &
> > _
> >  "[38C10RH_1735]


Quote:
> &
> > _


Quote:
> &
> > _

"

- Show quoted text -

Quote:
> > & _

> >  " FROM tbl_LiqDetergent " & _
> >  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value &
> "')"
> > & _
> >  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
> >  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "

> > This select statement works. I call this select statement before the one
> > above.

> > strSQL = "SELECT avg(Unexposed_1735),avg(Unexposed_1570), " & _


> >  "avg(Unexposed_1654), avg(Unexposed_1161),


Quote:
> &
> > _

> > avg(Ambient_1096)," & _

> > avg(Ambient_1161)," & _

> > avg([38C80RH_1735]),avg([38C80RH_1570])," & _

> > avg([38C80RH_1654]), " & _

[
Quote:
> > 38C10RH_1570]), " & _
> >  "avg([38C10RH_1735])

&
> _

1
)
s

- Show quoted text -

Quote:

> >  " FROM tbl_LiqDetergent " & _
> >  "WHERE (((tbl_LiqDetergent.ProductCode) = '" & cboproductCode.Value &
> "')"
> > & _
> >  "And ((tbl_LiqDetergent.FilmCode) = '" & cboFilmCode.Value & "') " & _
> >  "And ((tbl_LiqDetergent.day) = '" & day.Value & "')) "



Sat, 19 Feb 2005 23:22:13 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. ADO Control against ADO 2.1 and ADO 2.0

2. Problem opening recordset for update ADO 2.1/Jet 4.0/Access 2000 stored proc

3. ADO 2.1 with Oracle Client Problems

4. ADO 2.1 with Oracle Client Problems

5. ADO 2.1 & Win98 2nd Edition Problem

6. VB6 (SP3) & ADO 2.1 problem

7. ADO 2.1 Jet SEEK Problem

8. Problems with ADO 2.0 and 2.1

9. Problem with ADO 2.0 and 2.1

10. Problem writing to Access 97 DB with ADO 1.5 and 2.1 (using ODBC)

11. Problem opening recordset for update ADO 2.1/Jet 4.0/Access 2000 stored proc

12. ADO 2.1 with Oracle Client Problems

 

 
Powered by phpBB® Forum Software