Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prob getting recordset from a UNION query.

Status
Not open for further replies.

qwert231

Programmer
Sep 4, 2001
756
US
I have dumped the generated query to the screen and tried the query right in Access, so it does work. The database is in Access, I am using VB Script, on a Win XP box with IIS5 and FP 2k2 extensions.

Error Codes:
Error Type:
(0x80004005)
Unspecified error
/weddingSend.asp, line 179

My Code:
Code:
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Inetpub\CCLWeb\databases\webForm.mdb;Persist Security Info=False"
tempStr = "SELECT '14' AS Size, sum([14]) AS tot FROM wedDetails WHERE [14m] LIKE 'AB' AND OrderID LIKE '" & nowJob & "'"
tempStr = tempStr & " UNION SELECT '20', sum([20]) AS tot FROM wedDetails WHERE [20m] LIKE 'AB' AND OrderID LIKE '" & nowJob & "'"
tempStr = tempStr & " UNION SELECT '24', sum([24]) AS tot FROM wedDetails WHERE [24m] LIKE 'AB' AND OrderID LIKE '" & nowJob & "'"
Response.Write tempStr & &quot;<br />&quot;
'RecSelectW tempStr
set recSet = Server.CreateObject(&quot;ADODB.Recordset&quot;)
recSet.open tempStr, strConnect, adOpenStatic '--> This is line 179.

 
K, here is what I found. If I took out the contstants I can access this query. Does ASP not like queries that create constants? (ie, where it says
Code:
SELECT '14' AS Size
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top