Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on 

ACCESS - 255

Access (in Design view) allows only 255 max for each field size. What if I use Insert statement and the user input more than that? Is there a way to allow them to input beyond  255 char?
Visual Basic.NET

Avatar of undefined
Last Comment
Sancler
Avatar of Sancler
Sancler

You will only be able to do this if the Access field type is Memo, rather than Text.  For the parameter datatype in the insert command use OleDbType.VarWChar, with a size of 0.  Then the only limit will be any that is placed on user input by the control in which that happens.

Roger
Avatar of VBdotnet2005
VBdotnet2005
Flag of United States of America image

ASKER

Dim ConnectionString As String = "provider=microsoft.jet.oledb.4.0;" + "data source =  C:\Documents and Settings\MAX.MCCI_DOM\Desktop\MAX\bad.mdb"
        Dim Command As OleDbCommand


        Try
            'Dim Connection As OleDbConnection = New OleDbConnection(ConnectionString)
            Dim Connection As New OleDbConnection(ConnectionString)

            Connection.Open()

            Command = New OleDbCommand("insert into BadTable(Address, CityState, accurint ) values ('" & Me.txtAddress.Text & "' , '" & Me.txtCity.Text & "', '" & Me.txtSave.Text & "')", Connection)

            Command.ExecuteNonQuery()

            Connection.Close()


        Catch ex As OleDbException

            MsgBox(ex.ToString)


        End Try
    End Sub
Avatar of Sancler
Sancler

What's that supposed to mean?
Avatar of VBdotnet2005
VBdotnet2005
Flag of United States of America image

ASKER

Above is btnAdd -  Me.txtSave.Text   is the only one I am questioning really. I want this filed to be able to contain more than 255 charactor. I don't understand this part  -
  For the parameter datatype in the insert command use OleDbType.VarWChar, with a size of 0. --- I thought I put this comment above my code.
ASKER CERTIFIED SOLUTION
Avatar of Sancler
Sancler

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo