SQL error

  • Thread starter Thread starter Angelina
  • Start date Start date
A

Angelina

Hi,

Im trying to enter a query into the query builder for in
the OLEDBdataAdapter wizard. My query is as follows:

SELECT
a.Caravan_Inv_No,
a.Caravan_Model,
a.Length,
b.Beds,
b.[Cost/day]
FROM
Caravan_Inv a,
Caravan_details b
WHERE
a.Caravan_Inv_No = b.Caravan_Inv_No AND
a.Length = b.Length AND
a.Caravan_Inv_No NOT IN
(SELECT c.Caravan_Inv_No
FROM Caravan_booking c , Booking_details d
WHERE c.BookingNo = d .BookingNo
AND Dt_of_arrival BETWEEN ? AND ?
AND Dt_of_depature BETWEEN ? AND ?)


i keep getting the following error:
Failed to get schema for this query.

does anyone have any idea of what the problem is??

btw, i have used '?' to represent a value that has to be
passed in from 2 of my dtpickers. is this the right way
to write this? (i have an access db)

thx
 
Sure. The DACW is pretty limited in this respect. When you code more complex
queries (including using JOINS or subqueries (like yours)). See my article
on using (or not using) the DACW. http://www.betav.com/msdn_magazine.htm I
recommend you put all of this into a SP where the resultset is a bit easier
to "discover" and execute it with a drag and drop SP.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Hi,

thx for your help. Im not suer on hope to create SPROCS
in Access.....is it possible??
I dont have SQLServer and my DB is created in Access :o(

-----Original Message-----
Sure. The DACW is pretty limited in this respect. When you code more complex
queries (including using JOINS or subqueries (like yours)). See my article
on using (or not using) the DACW.
http://www.betav.com/msdn_magazine.htm I
recommend you put all of this into a SP where the resultset is a bit easier
to "discover" and execute it with a drag and drop SP.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Hi,

Im trying to enter a query into the query builder for in
the OLEDBdataAdapter wizard. My query is as follows:

SELECT
a.Caravan_Inv_No,
a.Caravan_Model,
a.Length,
b.Beds,
b.[Cost/day]
FROM
Caravan_Inv a,
Caravan_details b
WHERE
a.Caravan_Inv_No = b.Caravan_Inv_No AND
a.Length = b.Length AND
a.Caravan_Inv_No NOT IN
(SELECT c.Caravan_Inv_No
FROM Caravan_booking c , Booking_details d
WHERE c.BookingNo = d .BookingNo
AND Dt_of_arrival BETWEEN ? AND ?
AND Dt_of_depature BETWEEN ? AND ?)


i keep getting the following error:
Failed to get schema for this query.

does anyone have any idea of what the problem is??

btw, i have used '?' to represent a value that has to be
passed in from 2 of my dtpickers. is this the right way
to write this? (i have an access db)

thx


.
 
Jet does support QueryDefs which are (simple) "stored" procedures.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Angelina said:
Hi,

thx for your help. Im not suer on hope to create SPROCS
in Access.....is it possible??
I dont have SQLServer and my DB is created in Access :o(

-----Original Message-----
Sure. The DACW is pretty limited in this respect. When you code more complex
queries (including using JOINS or subqueries (like yours)). See my article
on using (or not using) the DACW.
http://www.betav.com/msdn_magazine.htm I
recommend you put all of this into a SP where the resultset is a bit easier
to "discover" and execute it with a drag and drop SP.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

Hi,

Im trying to enter a query into the query builder for in
the OLEDBdataAdapter wizard. My query is as follows:

SELECT
a.Caravan_Inv_No,
a.Caravan_Model,
a.Length,
b.Beds,
b.[Cost/day]
FROM
Caravan_Inv a,
Caravan_details b
WHERE
a.Caravan_Inv_No = b.Caravan_Inv_No AND
a.Length = b.Length AND
a.Caravan_Inv_No NOT IN
(SELECT c.Caravan_Inv_No
FROM Caravan_booking c , Booking_details d
WHERE c.BookingNo = d .BookingNo
AND Dt_of_arrival BETWEEN ? AND ?
AND Dt_of_depature BETWEEN ? AND ?)


i keep getting the following error:
Failed to get schema for this query.

does anyone have any idea of what the problem is??

btw, i have used '?' to represent a value that has to be
passed in from 2 of my dtpickers. is this the right way
to write this? (i have an access db)

thx


.
 
Back
Top