Re: Help with TableAdapter

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



No I don't but I'm confused as to how that would that help?

S
"Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx> wrote in message
news:OS0WWOAeHHA.1868@xxxxxxxxxxxxxxxxxxxxxxx
Sal,

Do you have option strict on in top of your program?

Cor

"SAL" <SAL_@xxxxxxxx> schreef in bericht
news:%23OdwR57dHHA.1216@xxxxxxxxxxxxxxxxxxxxxxx
Hi Mike,
Here's the query:
SELECT
ReportedWeeds.RID, Weeds.Name, ReportedWeeds.Density, BioAgents.BName,
ReportedWeeds.Assr_SN, ReportedWeeds.TownRange, ReportedWeeds.LotSize,
ReportedWeeds.theDate, ROW.[Desc] AS RDesc, ReportedWeeds.Owner,
ReportedWeeds.OwnStAddrs, ReportedWeeds.OwnCity, ReportedWeeds.OwnState,
ReportedWeeds.OwnZip, ReportedWeeds.OwnPhone, MethodContacted.[Desc] AS
MDesc, ReportedWeeds.SitusHsnbr + ' ' + ReportedWeeds.SitusStDir + ' ' +
ReportedWeeds.SitusStName + ' ' + ReportedWeeds.SitusSType + ' ' +
ReportedWeeds.SitusCity AS SITADDRS, ReportedWeeds.Source,
ReportedWeeds.SourceCity, ReportedWeeds.SourceState,
ReportedWeeds.SourceStDir,
ReportedWeeds.SourceHsnbr, ReportedWeeds.SourceStName,
ReportedWeeds.SourceZip, ReportedWeeds.SourcePhone,
ReportedWeeds.Comments, ReportedWeeds.FollowUp,
ReportedWeeds.FollowUpNotes,
ReportedWeeds.Atlas

FROM ((((ReportedWeeds LEFT OUTER JOIN
ROW ON ReportedWeeds.ROWID = ROW.ROWID) LEFT OUTER JOIN
Weeds ON ReportedWeeds.WID = Weeds.WID) LEFT OUTER JOIN
MethodContacted ON ReportedWeeds.MCID = MethodContacted.MCID) LEFT OUTER
JOIN
BioAgents ON ReportedWeeds.BioAgent = BioAgents.BAID)

WHERE (ReportedWeeds.Source LIKE '%' + ? + '%') AND
(ReportedWeeds.theDate
= ?) AND (ReportedWeeds.theDate <= ?)

What I found was that the concatenated field was causing the problem. I'm
thinking that Access thinks the + character is for adding numbers (i.e.,
double) and that's what's producing the error. However, if I change the
concatenation to characters Access likes to use (i.e., the ampersand and
the double quote), then the designer doesn't like that. So, it's like a
catch 22 here. What I'm doing in the interim is just including the fields
and concatenating the values for those fields and passing it to my
reports. Ugly but it's working for now. I would love to have it work like
it's supposed to..

Thanks for looking

S


"Mike McIntyre" <mikemc@xxxxxxxxxxxxxxxxx> wrote in message
news:e0QGFtydHHA.4656@xxxxxxxxxxxxxxxxxxxxxxx
Can you send the query with the problem so it can be inspect or
correctness?

--
Mike

Mike McIntyre [MVP]
http://www.getdotnetcode.com


"SAL" <SAL_@xxxxxxxx> wrote in message
news:%2381XKntdHHA.2268@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
Using the designer in my project, I created a DataTable for one of the
tables in an Access database. I created a TableAdapter for that
DataTable by adding queries. For the most part, the queries are
executing correctly but this one does not return any rows. If I past
the sql into the Access database from the TableAdapter, it returns
rows. Does anyone know how to debug what the command is sending to the
Access database for any particular query?
This query uses parameters and I'm afraid it's not sending the where
clause correctly..

Any help with this would be much appreciated

S









.



Relevant Pages

  • Re: Help with TableAdapter
    ... with option strict on it will give an error. ... FROM ((((ReportedWeeds LEFT OUTER JOIN ... the sql into the Access database from the TableAdapter, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Join problem i Access
    ... Im running the following query on an Access database: ... ADOQuery.SQL.Add('From ((AlarmEvents AE'); ... ADOQuery.SQL.Add('Left Outer Join Alarms On Alarms.AlarmID = AE.AlarmID)'); ... When I run the same query from within Access it executes without problem... ...
    (borland.public.delphi.database.ado)
  • Re: Join problem i Access
    ... Im running the following query on an Access database: ... ADOQuery.SQL.Add('From ((AlarmEvents AE'); ... ADOQuery.SQL.Add('Left Outer Join AlarmTypes On AlarmTypes.AlarmType = ... When I run the same query from within Access it executes without ...
    (borland.public.delphi.database.ado)
  • Re: Help with TableAdapter
    ... Here's the query: ... FROM ((((ReportedWeeds LEFT OUTER JOIN ... sql into the Access database from the TableAdapter, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Help with TableAdapter
    ... Access supports + for concatenation. ... FROM ((((ReportedWeeds LEFT OUTER JOIN ... the sql into the Access database from the TableAdapter, ... Access database for any particular query? ...
    (microsoft.public.dotnet.languages.vb)