Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > UnboundString error and total amount

Thread Tools Display Modes
Old 04-24-2012, 11:31 PM
jhon1977 jhon1977 is offline
Join Date: Jan 2011
Posts: 1
Default UnboundString error and total amount

Gud am to all fellow vb programmer need help UnboundString and sum code below:

Public con As New ADODB.Connection
Public sSQL As String

Public rs As New ADODB.Recordset

Sub Main()
   Call getcon
   Load Form2
End Sub

Public Sub getcon()
On Error GoTo suRedb1
  con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Database\DATA.mdb; jet oledb:database password=jhoncel"
  Exit Sub
   Gs = "Either Database doesnot exist or" + vbCr
   Gs = Gs + "Database password has changed:."
   MsgBox Gs, vbCritical

End Sub
Option Explicit

Dim Report As New CrystalReport1
Dim clientrecord As New ADODB.Recordset
Dim clientRS As ADODB.Recordset
Dim strSQL As String

Private Sub Form_Load()

Screen.MousePointer = vbHourglass

    clientrecord.Open "SELECT * from client", con, adOpenKeyset, adLockPessimistic

    With Report

'       ***********This is the error or erro in code***********

        .UnboundString1.SetUnboundFieldSource clientrecord.Fields("fname")
        .UnboundNumber1.SetUnboundFieldSource clientrecord.Fields("book")

        .PaperOrientation = 1
        .PaperSize = 2
    End With

CRViewer91.ReportSource = Report
Screen.MousePointer = vbDefault

End Sub

Private Sub Form_Resize()
CRViewer91.Top = 0
CRViewer91.Left = 0
CRViewer91.Height = ScaleHeight
CRViewer91.Width = ScaleWidth

End Sub

Last edited by Flyguy; 04-25-2012 at 01:10 AM. Reason: Added [code] [/code] tags
Reply With Quote
Old 04-25-2012, 10:45 AM
Gruff's Avatar
Gruff Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
Join Date: Aug 2003
Location: Oregon, USA
Posts: 6,440

You should have titled you post as "Crystal Reports Error".

What is the Error that is being reported?

I believe all you are showing is where the error occurs.


Based on what you show I would expect the error to be either
your crystal reports object is not Instantiated or there is a problem with your database.

Check to see if any records are returned in your recordset first.
RS.Open(...) With RS if .EOF then Msgbox "No Records Found for this Query" Else ' Try to fill the crystal object here. End if End With
Burn the land and boil the sea
You can't take the sky from me


Last edited by Gruff; 04-25-2012 at 10:59 AM.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..