Results 1 to 12 of 12
Thread: SQL query woes
Dec 12, 2001, 15:00 #1
- Join Date
- May 2001
- View Ridge
- 0 Post(s)
- 0 Thread(s)
SQL query woes
Its me again,
This is a follow up to another post. Hopefully I can explain my probs a little better.
I'm trying to join the field names in one table with descriptive text in another table.
Say I have main_table with the fields cat, dog, cow.
In another table (description_table)there are 2 fields fldName,fldDescription:
fldName | fldDescription
dog | woof
cat | meow
cow | moo
I want to join the field names in main_table with the values in description_table fldName and return the fldDescription to the recordset so I can use the fldDescription as a header row:
woof | meow | moo
what I've got:
<% Dim oCommand, oRS Set oCommand = Server.CreateObject("ADODB.Command") 'strConnect passed from Include File "DataConnection.asp" oCommand.ActiveConnection = strConnect oCommand.CommandText = "select * from main_table, description_table _ where main_table.Field.Name=description_table.fldName" oCommand.CommandType = adCmdText 'Create the recordset based on the oCommand SQL query Set oRS = oCommand.Execute 'this is the line returning the error 'oCommand has done its job so close it & clean up Set oCommand = Nothing 'html table markup omitted While not oRS.EOF Response.Write "<th>" & oRS("fldDescription") & "</th>" oRS.MoveNext Wend 'oRS has done its job so close it & claen up oRS.Close Set oRS = Nothing %>
Microsoft JET Database Engine error '80040e10' No value given for one or more required parameters. /wpcf_v2/aspTest/svcReqNames.asp, line 24
Any help would be much appreciated!