ACC1x: GetChunk on ODBC Table Returns "Invalid Argument"
ID: Q109403
|
The information in this article applies to:
-
Microsoft Access versions 1.0, 1.1
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
- 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.
- Start Microsoft Access and open the sample database NWIND.MDB.
- 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.
- From Microsoft Access, add one record to the table.
- 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
- 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