Re: ADO data control



You don't say if you are using SQL Server, but if so, run your query in the
Query Analyzer to find your problem. With a bit more work, you can also
reconstruct the query in Access if you are using a JET database. Also, you
didn't show your strings for the WHERE and ORDER BY clauses, so that may
also be the issue. If you have control over the database, you should
consider normalizing, dropping the "tbl" prefix, and using aliases for your
table names in the query. You will not only improve the performance, but
also make the queries much easier to read.

"Darhl Thomason" <darhlt@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:u5MdwyUUGHA.4792@xxxxxxxxxxxxxxxxxxxxxxx
I'm having problems with my ADO data control. When I pass a very simple
SQL statement to it, it works fine. But I have a db I need to open with
multiple tables that has relationships that need to be created. So, my
SQL statement is built with multiple INNER JOIN's. Note that strWhere and
strOrder are defined in different subs. The error I get is "No value
given for one or more required Parameters." The line that is highlighted
when I debug it is:

cnPOSData.Refresh

Here is my SQL:

cnPOSData.RecordSource = "SELECT tblStoreData.PmiNumber,
tblStoreData.Store, tblStoreData.Address, tblStoreData.City, " & _
"tblStoreData.Zip, tblStoreData.InstallDate,
tblStoreData.InstallDateChanged, tblStoreData.OpenDate, " & _
"tblStoreData.OpenDateChanged, tblStoreData.StoreOpen,
tblStoreData.NewStore, tblStoreData.FirstContactDate, " & _
"tblStoreData.PackageSentDate, tblStoreData.Phone,
tblStoreData.PO, tblStoreData.Processor, tblStoreData.MerchNum, " & _
"tblStoreData.EFSNetLogin, tblStoreData.EFSNetPW,
tblStoreData.EFSNetID, tblStoreData.EFSNetKey, " & _
"tblStoreData.PCChargeSerial,
tblStoreData.PCChargeSecurityCode, tblStoreData.PCChargeSystemCode,
tblStoreData.DSL, " & _
"tblStoreData.Static_IP, tblStoreData.POC,
tblStoreData.Comments, tblStoreData.NAFEligible, tblStoreData.NAFRefund, "
& _
"tblStoreData.FASigned, tblStoreData.FAExpires,
tblCheckListStatus.WeekName, tblStatus.StatusName, tblDMA.DMAName, " & _
"tblType.TypeName, tblFC.FCEmail, tblFC.FCName,
tblOwners.OwnerName, tblOwners.OwnerContact, tblOwners.OwnerPhone, " & _
"tblOwners.OwnerEmail, tblDistrict.DistrictName,
tblDistrict.DomName, tblDistrict.DomEmail, tblRegion.RegionName, " & _
"tblStoreData.DistrictID, tblStoreData.DMAID,
tblStoreData.FCID, tblStoreData.RegionID, tblStoreData.OwnerID, " & _
"tblStoreData.StatusID, tblStoreData.TypeID,
tblStoreData.WeekID " & _
"FROM tblType INNER JOIN (tblCheckListStatus INNER JOIN
(tblStatus INNER JOIN (tblDMA INNER JOIN (tblFC " & _
"INNER JOIN (tblDistrict INNER JOIN (tblOwners INNER JOIN
(tblRegion INNER JOIN tblStoreData " & _
"ON tblRegion.RegionID = tblStoreData.RegionID) ON
tblOwners.OwnerID = tblStoreData.OwnerID) " & _
"ON tblDistrict.DistrictID = tblStoreData.DistrictID) ON
tblFC.FCID = tblStoreData.FCID) " & _
"ON tblDMA.DMAID = tblStoreData.DMAID) ON tblStatus.StatusID =
tblStoreData.StatusID) " & _
"ON tblCheckListStatus.WeekID = tblStoreData.WeekID) ON
tblType.TypeID = tblStoreData.TypeID " & _
"WHERE " & strWhere & " ORDER BY " & strOrder

Any ideas where I'm going wrong?

Thanks,

Darhl



.



Relevant Pages

  • Re: SQl Data Provider Performance Issues
    ... selects with a single inner join perforn OK. ... When I run the query from SQL ... Analyzer, SQL Profiler shows a duration of 30. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Ranking query
    ... I expect that using a named query (as opposed to its SQL) will be OK. ... INNER JOIN qryRepairs AS I2 ...
    (microsoft.public.access.queries)
  • Re: SQl Data Provider Performance Issues
    ... selects with a single inner join perforn OK. ... When I run the query from SQL Query ... Analyzer, SQL Profiler shows a duration of 30. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQl Data Provider Performance Issues
    ... Can you provide a complete sample app ... selects with a single inner join perforn OK. ... When I run the query from SQL ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQl Data Provider Performance Issues
    ... selects with a single inner join perforn OK. ... When I run the query from SQL ... Analyzer, SQL Profiler shows a duration of 30. ...
    (microsoft.public.dotnet.languages.csharp)