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 3987
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: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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...
| |