Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Location
    Dubai
    Posts
    40

    Unanswered: can you change it

    Hi

    This code is for Access db

    Code:
    	strSQL = "SELECT TOP 20 tblThread.Topic_ID, Subject, Username, tblThread.Thread_ID, Message, Message_date "
      	strSQL = strSQL & "from tblTopic, tblThread, tblAuthor "
    	strSQL = strSQL & "where tblThread.Topic_ID = tblTopic.Topic_ID "
    	strSQL = strSQL & "and tblThread.Author_ID = tblAuthor.Author_ID "
    	strSQL = strSQL & "order by Message_date DESC"
    can you rewrite it for SQL Db

    with this


    Code:
    	strSQL = EXECUTE

    thanks

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    set rs = connection_object.execute(strSQL)
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    May 2004
    Location
    Dubai
    Posts
    40
    Thanks
    but I mean please write somethnig like this

    strSQL = "EXECUTE " & strDbProc & "ActiveTopics @dblActiveFrom = " & dblActiveFrom & ", @AuthorID = " & lngLoggedInUserID & ", @GroupID = " & intGroupID

    thanks

  4. #4
    Join Date
    Sep 2004
    Location
    Helsinki, Finland
    Posts
    45
    Is it something like this that you are looking for?

    Code:
    SET @SQL = "SELECT TOP 20 tblThread.Topic_ID, Subject, Username, tblThread.Thread_ID, Message, Message_date from tblTopic, tblThread, tblAuthor
                where tblThread.Topic_ID = tblTopic.Topic_ID and tblThread.Author_ID = tblAuthor.Author_ID
                order by Message_date DESC"
    
    EXEC (@SQL)

Posting Permissions

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