Re: ADO data control
- From: "Earl" <brikshoe@xxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Mar 2006 05:14:57 -0500
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
.
- Follow-Ups:
- Re: ADO data control
- From: Darhl Thomason
- Re: ADO data control
- References:
- ADO data control
- From: Darhl Thomason
- ADO data control
- Prev by Date: Re: How to stop VB creating .oca files
- Next by Date: Re: Is my Control a cotrol array ??
- Previous by thread: ADO data control
- Next by thread: Re: ADO data control
- Index(es):
Relevant Pages
|