PRB: DAO Recordset Name Property Is Limited to 256 Characters (168194)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q168194 SYMPTOMS
The Name property of a DAO Recordset object is limited to 256 characters.
It only reports the first 256 characters of the SQL statement used to
create the new Recordset. If the SQL statement is longer than 256
characters, and you refresh the Data Control in the code later on, you will
receive one of the following errors:
"Run-time error '3061': Too few parameters. Expected 1"
-or-
"Run-time error '3075': Syntax error in string in query
expression 'xxxx'"
CAUSE
When you set the Data Control's Recordset property to an existing
Recordset, it obtains its RecordSource property from the DAO Recordset's
Name property, which allows a maximum length of 256 characters.
RESOLUTION
Store the SQL statement into a string variable. Before refreshing the Data
Control, set its RecordSource Property to this variable. For example:
Data1.RecordSource = SQLStr
Data1.Refresh
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 6/28/2004 |
---|
Keywords: | kbprb KB168194 |
---|
|