How to select subset of table with more than 255 columns?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johngray0
    New Member
    • Jan 2010
    • 4

    How to select subset of table with more than 255 columns?

    I have a table that is being imported from Sybase that contains > 255 fields.

    We only need a small subset of these fields, however, so the desired stored table is something Access can handle (~ 20 columns).

    The connection setup is ODBC, and of course, an openrecordset command just gives the first 256 fields. When I do a SELECT on a fields not in the first 255, of course, there is an error.

    Is there a way in VBA to select a suitable small subset of fields from a table with > 255 fields?

    Or, might it be possible to read in the last column first? That way I can sweep the table from both ends to get what we want.

    Oh, I know the first thought is: why not reduce the size of the table? Unfortunately, that is not an option due to business/management considerations.

    Thank you,
    John
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    My approach would be to create a query in Sybase holding the needed rows an import that query instead of the table.
    An alternative might be to create a pass-through query in Access and use that instead of the table. The pass-through query needs to be in Sybase SQL format !

    Nic;o)

    Comment

    • johngray0
      New Member
      • Jan 2010
      • 4

      #3
      Nico,

      Thank you for the reply.

      The pass-through query in Access sounds good. Now, as someone who has not tried this approach before, do you know of a resource that might outline the basic steps for doing this? Like a link to a tutorial, perhaps? The syntax at least, I can look up.

      Th

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        It's rather easy, as all that's needed is to select "Pass-Through" as the query type in design mode.
        This will allow you to specify in the query properties the ODBC connection.
        Access will switch to SQL text mode and you can enter the (Sybase!) SQL string needed.

        Guess the helpfile does hold some info too.

        Nic;o)

        Comment

        • TheSmileyCoder
          Recognized Expert Moderator Top Contributor
          • Dec 2009
          • 2322

          #5
          Or create a make-table query from within Sybase, then import that table.

          Comment

          Working...