473,322 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Textbox truncate

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
Nov 20 '05 #1
4 3984
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

Nov 20 '05 #2
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

Nov 20 '05 #3
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
Nov 20 '05 #4
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

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
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...
3
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...
1
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...
4
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...
7
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...
2
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...
9
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...
10
by: Troels Arvin | last post by:
Hello, Until this date, I believed that DB2 has no TRUNCATE TABLE command. But then I came across...
9
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...
5
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.