Solved

String too long I guess!

Posted on 2002-03-26
4
317 Views
Last Modified: 2011-04-14
I use a procedure to create a listbox that shows all the queries in a database, so the user can select a query to run.

In testing, I ran into error 2176, something about "The text you are putting in this field is the wrong size, it must be either 255 or 2048 bytes...."  (I'm paraphrasing there!)

I set the list box for ROwSource=ValueList.

The DB I was using had LOTS of queries, so maybe the list was too big.  Anyway to handle this?  I suppose, the string I build containing queries, I could split into 200 char chunks, and display them thusly....And why do some queries come up with wierd names that I can't see in the DB window (things like ~sqqryWhatItIs).

Doug
0
Comment
Question by:dougp23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
SE081398 earned 50 total points
ID: 6896641
I would tend to think that the value list can support up to 255 charactors. Dumb question but are you separating the values with semicolons?

another way to try this is by writing the names of the queries to a temp table and then set the controlsource of the list box to the temp table.  see if it displays.

with temptable
delete everything

keep the list box hidden(visible = false)
create a table with 1 field
loop through your querydefs and retrieve the names
write each name to the table

listbox.requery
listbox.visible= true

0
 
LVL 2

Expert Comment

by:mrt1
ID: 6896753
A list box can display a maximum of 255 entries, and each entry can be a maximum of 255 characters.
The character length shouldn't be an issue, because I don't think a query name can exceed 255 characters either.

The strange "~sqqry" entries are probably temporary querydefs that Access creates beind the scenes to help run your code. You should be able to filter out this entries using an SQL expression (e.g: SELECT *
FROM MSysQueries WHERE.....)
0
 
LVL 1

Author Comment

by:dougp23
ID: 6897075
Nice idea.  Yea, separated with commas.
I will do the table thing.  Thank you.
0
 
LVL 3

Expert Comment

by:SE081398
ID: 6897099
You're welcome.

If you need any more help doing this let me know.  I was brief in the explaination but I hope you got the idea.


SE


0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question