Run MS-Access Query

Discussion in 'ASP .Net' started by Saber, Aug 24, 2004.

  1. Saber

    Saber Guest

    I've two queries in MS-Access, named "Archive" and "final", how can I excute
    them?

    perhaps it helps:

    ----Archive Query------------------------------
    SELECT LAST(a.id) AS PostID, LAST(a.posttitle) AS PostTitle,
    LAST(a.posttext) AS PostText, LAST(a.posttype) AS PostType, LAST(a.postdate)
    AS PostDate, LAST(a.posttopic) AS PostTopic, LAST(a.authorid) AS AuthorID
    FROM tblPosts AS a INNER JOIN tblPosts AS b ON a.id<=b.id
    GROUP BY a.id
    HAVING COUNT(*) Between 5 And 10;
    ---------------------------------^------^^------


    ----final Query---------------------------------
    SELECT Archive.*, tblAuthors.*
    FROM Archive INNER JOIN tblAuthors ON Archive.AuthorID=tblAuthors.ID;
    ------------------------------------------------


    one more thing: I want to send variables instead of 5,10 in first query. It
    is easy if I want just excute first query, but I want to excute both.
    I pass strSql to a function: showRpt(dtrWeblog, rptWeblog, strSql)


    Sub showRpt(ByVal dtr As OleDbDataReader, ByVal rpt As Repeater, ByVal str
    As String)

    cmdSqlWeblog = New OleDbCommand(str, con)

    ConnectDB(con)

    dtr = cmdSqlWeblog.ExecuteReader

    rpt.DataSource = dtr

    rpt.DataBind()

    dtr.Close()

    DisconnectDB(con)

    cmdSqlWeblog.Dispose()

    End Sub



    Thanks in advance

    --
    Saber S.
    http://maghalat.com (Persian)
    Saber, Aug 24, 2004
    #1
    1. Advertising

  2. Saber

    Saber Guest

    No idea?
    Saber, Aug 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Learner
    Replies:
    1
    Views:
    973
    Marina Levit [MVP]
    Jan 30, 2006
  2. Anonymous
    Replies:
    0
    Views:
    1,439
    Anonymous
    Oct 13, 2005
  3. David Gordon

    xpath query query

    David Gordon, May 18, 2005, in forum: XML
    Replies:
    2
    Views:
    777
    David Gordon
    May 18, 2005
  4. Eric Nelson
    Replies:
    5
    Views:
    1,504
    Alexey Smirnov
    Feb 4, 2009
  5. Jon F.

    CAML Query: Multiple Query Fields Issue

    Jon F., May 12, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    741
    Jon F.
    May 12, 2004
Loading...

Share This Page