Hi there,
I have an SQL query within an ASP statement that is not parsing correctly for some very strange reason. When I try and parse the statement, it coms up with the error, 'Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.'
I have successfully run the query within MS Access. The SQL query that I ran in Access is below:
Code:
Code:
SELECT DISTINCT sculpturetype.type AS sculpture_type, artist.FirstName AS artist_firstname, artist.Surname AS artist_surname FROM (sculpturetype INNER JOIN sculptures ON sculptures.SculptureTypeID = sculpturetype.TypeURL) INNER JOIN artist ON artist.NameURL = sculptures.ArtistID WHERE sculpturetype.TypeURL = 'Art-Deco' ORDER BY artist.FirstName;
My full ASP statement that is parsing an error is :-
Code:
Code:
<%
'Dimension variables
' Database connection
Set con = CreateObject("ADODB.Connection")
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.Open Server.MapPath("products.mdb")
Set rs = CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strQL = "SELECT DISTINCT sculpturetype.type AS sculpture_type, artist.FirstName AS artist_firstname, artist.Surname AS artist_surname FROM (sculpturetype INNER JOIN sculptures ON sculptures.SculptureTypeID = sculpturetype.TypeURL) INNER JOIN artist ON artist.NameURL = sculptures.ArtistID WHERE sculpturetype.TypeURL = 'Art-Deco' ORDER BY artist.FirstName;"
'Response.Write
'Open the recordset with the SQL query
rs.Open strSQL, Con
Response.Write (rs.Fields("sculpture_type"))
'Reset server objects
rs.Close
Set rs = Nothing
Set Con = Nothing
%>
I would really appreciate some advice as to why my ASP statement is not working correctly. This has completely stumped me and I have no idea why it's not working.
Any advice or help is greatly appreciated
Kind Regards
James