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?
Who is Participating?
SanclerConnect With a Mentor Commented:
If the Access field - accurint - to which Me.txtSave.Text is being sent is a Memo field that code should work.  The bit about OleDbType.VarWChar, with a size of 0 was for if you were doing your insert with parameters as you would, for example, with a dataadapter.  You can ignore it.


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.

VBdotnet2005Author Commented:
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

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


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



        Catch ex As OleDbException


        End Try
    End Sub
What's that supposed to mean?
VBdotnet2005Author Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.