simplest MDB question EVER

A

aaron.kempf

ok; this query works GREAT when I paste it into a new MDB query.
but it is 'too loose' when I run it as a ADO recordset... it is 'too
loose' because it catches a query named ''

Does anyone have a simple answer for this?
Is it the simple difference between a single quote and a double-quote?

This kinda crap has caught me up quite a bit recently... I mean; this
little crap has caught me up the last 4-5 times I've tried MDB and it
just drives me crazy.


Select [name]
from msysobjects
where LEFT([name], 4) = 'QF01' AND [name] not like '*template*'
ORDER BY [NAME]



this is my whole code:

Dim rstF As New ADODB.Recordset
rstF.Open "Select [name] from msysobjects where LEFT([name], 4) = "
& S_FlashLike & " AND [name] not like '*template*' ORDER BY [NAME]",
CurrentProject.Connection
Do Until rstF.EOF
FlashThisQuery (rstF!Name)
rstF.MoveNext
Loop
Set rstF = Nothing


?S_FlashLike
'QF01'

?rstF!Name
QF01_CT_QAttribute_TEMPLATE
 
S

Smartin

ok; this query works GREAT when I paste it into a new MDB query.
but it is 'too loose' when I run it as a ADO recordset... it is 'too
loose' because it catches a query named ''

Does anyone have a simple answer for this?
Is it the simple difference between a single quote and a double-quote?

This kinda crap has caught me up quite a bit recently... I mean; this
little crap has caught me up the last 4-5 times I've tried MDB and it
just drives me crazy.


Select [name]
from msysobjects
where LEFT([name], 4) = 'QF01' AND [name] not like '*template*'
ORDER BY [NAME]



this is my whole code:

Dim rstF As New ADODB.Recordset
rstF.Open "Select [name] from msysobjects where LEFT([name], 4) = "
& S_FlashLike & " AND [name] not like '*template*' ORDER BY [NAME]",
CurrentProject.Connection
Do Until rstF.EOF
FlashThisQuery (rstF!Name)
rstF.MoveNext
Loop
Set rstF = Nothing


?S_FlashLike
'QF01'

?rstF!Name
QF01_CT_QAttribute_TEMPLATE

Sorry if this is a bit dense... where is the query named '' coming in?
 
S

susiedba

sorry I got it

this is what i meant to say

?rstF!Name
QF01_CT_QAttribute_TEMPLATE



I didn't know that ADO used % as wildcard against MDB.. no wonder MDB
has always frustrated me :)

has it always been like that; for like 6 years???

since 1998 or whatever?





ok; this query works GREAT when I paste it into a new MDB query.
but it is 'too loose' when I run it as a ADO recordset... it is 'too
loose' because it catches a query named ''

Does anyone have a simple answer for this?
Is it the simple difference between a single quote and a double-quote?

This kinda crap has caught me up quite a bit recently... I mean; this
little crap has caught me up the last 4-5 times I've tried MDB and it
just drives me crazy.


Select [name]
from msysobjects
where LEFT([name], 4) = 'QF01' AND [name] not like '*template*'
ORDER BY [NAME]



this is my whole code:

Dim rstF As New ADODB.Recordset
rstF.Open "Select [name] from msysobjects where LEFT([name], 4) = "
& S_FlashLike & " AND [name] not like '*template*' ORDER BY [NAME]",
CurrentProject.Connection
Do Until rstF.EOF
FlashThisQuery (rstF!Name)
rstF.MoveNext
Loop
Set rstF = Nothing


?S_FlashLike
'QF01'

?rstF!Name
QF01_CT_QAttribute_TEMPLATE

Sorry if this is a bit dense... where is the query named '' coming in?
 
J

Jamie Collins

I didn't know that ADO used % as wildcard against MDB.. no wonder MDB
has always frustrated me :)

has it always been like that; for like 6 years???

since 1998 or whatever?

aaron/susie,
Yes, it has always been so.

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top