ACC1x: GetChunk on ODBC Table Returns "Invalid Argument"

ID: Q109403


The information in this article applies to:


SYMPTOMS

When you call the GetChunk method against a SQL Server or other ODBC table, Microsoft Access returns the error message: "Invalid Argument."


CAUSE

Microsoft Access does not properly support the GetChunk method against ODBC tables.


STATUS

Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.


MORE INFORMATION

Steps to Reproduce Problem


  1. Create a SQL Server table called SQLTest with a field called FldImage that has an image data type. Create a unique index on the table.


  2. Start Microsoft Access and open the sample database NWIND.MDB.


  3. Attach the SQLTest SQL Server table. The table name will be displayed as dbo.SQLTest, and will change to dbo_SQLTest after you attach it.


  4. From Microsoft Access, add one record to the table.


  5. Create a new module and enter the following sample code:
    
          Sub TestGetChunk()
             Dim MyDB As Database, MyDyna As Dynaset, s As String
    
             Set MyDB = CurrentDB()
             Set MyDyna = MyDB.CreateDynaset("dbo_SQLTest")
             s = MyDyna![FldImage].GetChunk(0, 10)
             MyDyna.Close
             MyDB.Close
          End Sub 


  6. Type the following in the module's Immediate window:

    TestGetChunk


Microsoft Access will halt the procedure on the GetChunk line, and will display the error message stated above.


Keywords          : kbprg PgmObj OdbcOthr 
Version           : 1.0 1.1
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: March 30, 1999