SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot tchoune's Avatar
    Join Date
    Jan 2004
    Location
    Québec
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question why does this doesnt work?

    Ok I have this line that work real good, it paged all throught my records without any problems.
    Code:
     rs.Open "nametable", connStr, adOpenForwardOnly, adLockReadOnly, _
      adCmdTableDirect
    
     If Len(Request("pagenum")) = 0  Then
      rs.AbsolutePage = 1
     Else
      If CInt(Request("pagenum")) <= rs.PageCount Then
       rs.AbsolutePage = Request("pagenum")
      Else
       rs.AbsolutePage = 1
      End If
     End If
    
     Dim abspage, pagecnt
      abspage = rs.AbsolutePage
      pagecnt = rs.PageCount
    
    
    and so on...
    When I try to insert a SELECT in the first line like this:
    Code:
     rs.Open "Select * from nametable", connStr, adOpenForwardOnly, adLockReadOnly, _
      adCmdTableDirect
    I got an erros message
    "Microsoft OLE DB Provider for ODBC Drivers error '80040e37'
    [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause."

    why?

  2. #2
    SitePoint Enthusiast
    Join Date
    Dec 2003
    Location
    New Zealand
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using adCmdText, not adCmdTableDirect


Bookmarks

Posting Permissions

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