accessing two or more tables

Results 1 to 4 of 4

Thread: accessing two or more tables

  1. #1
    firestonez Guest

    Default accessing two or more tables

    i use sql to access two tables, then i open the record set with the sql command.<BR>i try to access one of the columns of the other tables, system produce this error-"Item cannot be found in the collection corresponding to the requested name or ordinal"<BR><BR>my sql statement is "select E.*, from effects E, images I where movieID = (Select max(movieID)From effects) AND target = handle"<BR><BR>i try to get the record from two tables but fail, is there any other way???<BR><BR>

  2. #2
    James W. Guest

    Default RE: accessing two or more tables

    The &#039;name or ordinal not found&#039; error means one of the field names is incorrect. Are you getting this error when executing the SQL or when writing the results? It also looks like there is a space missing in between max(movieID) and FROM.

  3. #3
    firestonez Guest

    Default RE: accessing two or more tables

    the code below is what i do:<BR>first i define a sql statement<BR>second i put the stateemnt in the command of my<BR>third i access the record set<BR>NOTE that in my sql statement, i access two tables, and only in of the tables do it has the column called NAME, so am i wrong? pls help if possible, this is part of my project, a million thks.......<BR><BR><BR>dim str_effectsSql<BR><BR>str_effectsSql = "select E.*, from effects E, images I where E.movieID = (Select max(movieID)From effects) AND = I.handle"<BR> <BR>set obj_EffectsRecordSet = server.createObject("ADODB.Recordset")<BR>obj_Effe str_effectsSql, obj_DBConnection<BR><BR><BR>do until obj_EffectsRecordSet.EOF = true<BR> obj_openedFile.writeLine("&#060;image handle = " & obj_EffectsRecordSet("handle") & " name = " & obj_EffectsRecordSet("") & "/&#062;")<BR> obj_EffectsRecordSet.moveNext<BR> loop<BR>

  4. #4
    James W. Guest

    Default RE: accessing two or more tables

    I think I see the problem - when you response.write:<BR>obj_EffectsRecordSet("") <BR>the recordset doesn&#039;t &#039;know&#039; it came from a table referenced as I; do this:<BR>obj_EffectsRecordSet("name") <BR><BR>If that doesn&#039;t fix it, what line is giving the error?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts