I have a small app that is basically a catalog. When the user selects an item from a list box, it updates a description textbox with a description from an access db. Any description over 255 characters is truncated to 255. I have verified the access field is of type memo and the entire string is there. I have also tried setting the maxlength property to 700. It still truncates the text. Any Ideas? Here's the code that does the update
Private Sub Trans_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Trans.SelectedValueChange
Dim i As Double =
Dim descstring As Strin
If Trans.Text <> "No Transmissions Found" The
Desc.Clear(
Me.List1.Items.Clear(
DA = New OleDb.OleDbDataAdapter("select distinct cat_desc from [desc] where stocknum = '" & Trans.Text & "'", Dataconn
DA.Fill(Rst
If Rst.Rows.Count = 0 The
Desc.Text = "Description not available
Button3.Visible = Fals
Els
descstring = Trans.Text & " - " & (Rst.Rows(i)("cat_desc")
Desc.Text = descstrin
Rst.Clear(
DA = New OleDb.OleDbDataAdapter("select stocknum from [image] where stocknum = '" & Trans.Text & "'", Dataconn
DA.Fill(Rst
If Rst.Rows.Count = 0 The
Button3.Visible = Fals
Els
Button3.Visible = Tru
End I
End I
Rst.Clear(
End I
i =
Me.List1.Items.Clear(
If IsDBNull(Me.Engine.Text) = False The
DA = New OleDb.OleDbDataAdapter("SELECT Tag " &
" FROM query1 WHERE Stocknum = '" & Trans.Text & "' ", Dataconn
DA.Fill(Rst
If Rst.Rows.Count = 0 The
List1.Items.Add("No code numbers found."
Els
Do While i < Rst.Rows.Coun
List1.Items.Add(Rst.Rows(i)("tag")
i +=
Loo
Rst.Clear(
End I
End I
Me.list1label.Text = "Transmission Code Numbers
End Sub 4 3988
Check your schema for Rst (your dataset?), see if your limitation is there.
plus, what is the point of select distinct in that one query for the
cat_desc, it doesn't do anything... or at least I would HOPE it doesn't...
"Ben Gulley @aaronsap.com>" <bgulley<nospm> wrote in message
news:8F**********************************@microsof t.com... I have a small app that is basically a catalog. When the user selects an
item from a list box, it updates a description textbox with a description
from an access db. Any description over 255 characters is truncated to 255.
I have verified the access field is of type memo and the entire string is
there. I have also tried setting the maxlength property to 700. It still
truncates the text. Any Ideas? Here's the code that does the update: Private Sub Trans_SelectedValueChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Trans.SelectedValueChanged Dim i As Double = 0 Dim descstring As String If Trans.Text <> "No Transmissions Found" Then Desc.Clear() Me.List1.Items.Clear() DA = New OleDb.OleDbDataAdapter("select distinct cat_desc from
[desc] where stocknum = '" & Trans.Text & "'", Dataconn) DA.Fill(Rst) If Rst.Rows.Count = 0 Then Desc.Text = "Description not available" Button3.Visible = False Else descstring = Trans.Text & " - " &
(Rst.Rows(i)("cat_desc")) Desc.Text = descstring Rst.Clear() DA = New OleDb.OleDbDataAdapter("select stocknum from
[image] where stocknum = '" & Trans.Text & "'", Dataconn) DA.Fill(Rst) If Rst.Rows.Count = 0 Then Button3.Visible = False Else Button3.Visible = True End If End If Rst.Clear() End If i = 0 Me.List1.Items.Clear() If IsDBNull(Me.Engine.Text) = False Then DA = New OleDb.OleDbDataAdapter("SELECT Tag " & _ " FROM query1 WHERE Stocknum = '" & Trans.Text & "' ",
Dataconn) DA.Fill(Rst) If Rst.Rows.Count = 0 Then List1.Items.Add("No code numbers found.") Else Do While i < Rst.Rows.Count List1.Items.Add(Rst.Rows(i)("tag")) i += 1 Loop
Rst.Clear() End If End If Me.list1label.Text = "Transmission Code Numbers" End Sub
Check your schema for Rst (your dataset?), see if your limitation is there.
plus, what is the point of select distinct in that one query for the
cat_desc, it doesn't do anything... or at least I would HOPE it doesn't...
"Ben Gulley @aaronsap.com>" <bgulley<nospm> wrote in message
news:8F**********************************@microsof t.com... I have a small app that is basically a catalog. When the user selects an
item from a list box, it updates a description textbox with a description
from an access db. Any description over 255 characters is truncated to 255.
I have verified the access field is of type memo and the entire string is
there. I have also tried setting the maxlength property to 700. It still
truncates the text. Any Ideas? Here's the code that does the update: Private Sub Trans_SelectedValueChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Trans.SelectedValueChanged Dim i As Double = 0 Dim descstring As String If Trans.Text <> "No Transmissions Found" Then Desc.Clear() Me.List1.Items.Clear() DA = New OleDb.OleDbDataAdapter("select distinct cat_desc from
[desc] where stocknum = '" & Trans.Text & "'", Dataconn) DA.Fill(Rst) If Rst.Rows.Count = 0 Then Desc.Text = "Description not available" Button3.Visible = False Else descstring = Trans.Text & " - " &
(Rst.Rows(i)("cat_desc")) Desc.Text = descstring Rst.Clear() DA = New OleDb.OleDbDataAdapter("select stocknum from
[image] where stocknum = '" & Trans.Text & "'", Dataconn) DA.Fill(Rst) If Rst.Rows.Count = 0 Then Button3.Visible = False Else Button3.Visible = True End If End If Rst.Clear() End If i = 0 Me.List1.Items.Clear() If IsDBNull(Me.Engine.Text) = False Then DA = New OleDb.OleDbDataAdapter("SELECT Tag " & _ " FROM query1 WHERE Stocknum = '" & Trans.Text & "' ",
Dataconn) DA.Fill(Rst) If Rst.Rows.Count = 0 Then List1.Items.Add("No code numbers found.") Else Do While i < Rst.Rows.Count List1.Items.Add(Rst.Rows(i)("tag")) i += 1 Loop
Rst.Clear() End If End If Me.list1label.Text = "Transmission Code Numbers" End Sub
Found the issue. Like CJ said, the distinct is the issue. Too close to the code to see it I guess. Looks like the ODBC driver translates memo fields as text. This allows the distinct and returns text, but only the first 255 chars. Would never get away with a distict on a memo field directly in Access.
Go figure..
Thanks CJ
Ben
np.
"Ben Gulley" <an*******@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com... Found the issue. Like CJ said, the distinct is the issue. Too close to
the code to see it I guess. Looks like the ODBC driver translates memo
fields as text. This allows the distinct and returns text, but only the
first 255 chars. Would never get away with a distict on a memo field
directly in Access. Go figure...
Thanks CJ! Ben This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: martin |
last post by:
Hi,
We have a heavily used production server and a table which logs every
hit on a web site. This table has grown large over time and we want to
clear it down as efficiently as possible. We would...
|
by: LineVoltageHalogen |
last post by:
Greeting All, I have a stored proc that dynamically truncates all the
tables in my databases. I use a cursor and some dynamic sql for this:
......
create cursor
Loop through sysobjects and...
|
by: New MSSQL DBA |
last post by:
I have recently been assigned to take over several MSSQL environments
and found some of the existing practice confusing. As most of my
previous experiences are on Oracle and Unix platform so would...
|
by: Paul E Collins |
last post by:
I'm writing an application with a TextBox control on its main form.
I'm running the application under WinXP Pro, so (as I understand it)
there should be no practical limit to the number of...
|
by: Andrew |
last post by:
VB .NET 2003, WinXP Pro:
Adding text to a text box with the TextBox.AppendText method limits the
amount of text in the textbox to 32K.
I have a short program that uses the GetFiles function of...
|
by: rdraider |
last post by:
Hi,
I am trying to create a script that deletes transaction tables and leaves
master data like customer, vendors, inventory items, etc. How can I use
TRUNCATE TABLE with an Exists? My problem is...
|
by: Sumanth |
last post by:
Are there any implementations of truncate in db2. Is it going to be
implemented in the future?
Is there an alternate way of doing a truncate of a table that has a high
record count without using...
|
by: Troels Arvin |
last post by:
Hello,
Until this date, I believed that DB2 has no TRUNCATE TABLE command. But
then I came across...
|
by: Phill W. |
last post by:
VB.Net 2005 SP1
Windows Forms Application
What's the fastest way to append text to a TextBox?
I have an application that monitors data written to text files.
It needs to scan some fairly...
|
by: =?Utf-8?B?R1ROMTcwNzc3?= |
last post by:
Hi Guys,
It's been a while, I've got a small problem that I could do with your
expertise on.
As you know (I Think) I build websites for recruitment agencies, part of the
website includes a job...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |