Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8072955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:11:07+00:00 2026-06-05T14:11:07+00:00

Application written in VB6. DB is Pervasive v9.5. Currently works: Public Sub Save() if

  • 0

Application written in VB6. DB is Pervasive v9.5.

Currently works:

Public Sub Save()   
    if rs.State = adStateOpen Then
         rs.AddNew
         SetFields rs
         rs.Update
    End If
end sub

Public Sub SetFields(rs as ADODB.Recordset)
    rs!Name = strName
    StrToField strReport rs!Report
    StrToField strResponse rs!Response
end sub

Public Sub StrToField(ByVal str As String, fld As ADODB.Field)
    Dim Data As String
    Dim StrSize As Long, CharsRead As Long

    ' for field of LONVARCHAR type only
    If fld.Type = adLongVarChar Then
        StrSize = Len(str)
        Do While StrSize <> CharsRead
            If StrSize - CharsRead < BLOCK_SIZE_LONGVARCHAR Then
                Data = Mid(str, CharsRead + 1, StrSize - CharsRead)
                CharsRead = StrSize
            Else
                Data = Mid(str, CharsRead + 1, BLOCK_SIZE_LONGVARCHAR)
                CharsRead = CharsRead + BLOCK_SIZE_LONGVARCHAR
            End If
            fld.AppendChunk Data
        Loop
     Else
        ' do something
     End If
 End Sub

Const BLOCK_SIZE_LONGVARCHAR = 4096

This works fine until my report or response variable is larger than 32000 characters. I receive this error message when rs.update is called:

“[Pervasive][ODBC Client Interface] String length exceeds column length Parameter #15. Data truncated.”

Can anyone point me in the right direction or let me know if I am missing something. Pervasive Longvarchar max size should be 2GB.

Thanks,
Graham

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:11:09+00:00Added an answer on June 5, 2026 at 2:11 pm

    This code works form me using PSQL v11 (I don’t have v9.5).

    Dim conn As New ADODB.Connection
    Set conn = New ADODB.Connection
    conn.ConnectionString = "demodata"
    conn.Open
    Dim sql As String
    Dim cmd As New ADODB.Command
    cmd.ActiveConnection = conn
    cmd.CommandText = "insert into lvc (f2) values (?)"
    Dim parm As New ADODB.Parameter
    parm.Name = "f2"
    Dim longstring As String
    Open "c:\longdata.txt" For Input As #1
    Do While Not EOF(1)
       Line Input #1, sNextLine
       'do something with it
       'add line numbers to it, in this case!
       sText = sText & sNextLine
    Loop
    longstring = sText
    parm.Value = longstring
    cmd.Parameters.Append cmd.CreateParameter("param1", adLongVarChar, adParamInput, Len(longstring), longstring)
    cmd.Execute
    conn.Close
    MsgBox "done"
    

    Basically, you would use parameterized queries rather than the .AddNew method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a modem terminal application written in VB6. It works great for what
I am currently translating a windows form application, written in VB6, to a webpage
I maintain an old application written in VB6. In client's environment it raises runtime
We are trying to replace a COM server originally written for a VB6 application
I have an application written in VB6, and I need to use a library
I have an application written in VB6 that writes data to a spreadsheet. I'm
I have an old update program written in vb6, which runs as admin. However,
I have application written in Zend Framework and structure is app/ application/ library/ public/
My company has a large application written in VB6, and for historical reasons, the
I have a VB6 application that uses a COM DLL. The DLL is written

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.