Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index"

CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index"

Scheduled Pinned Locked Moved Visual Basic
databasehelpquestion
12 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vbDiggerz
    wrote on last edited by
    #1

    anybody who knows or have an idea about this error in VB2005 and CrystalRport XI R2 and MS ACCESS? CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Here's my code: ************************ Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Public strSelectionfrm As String Public strCRSourcePath As String Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ChildFormAutoSizeFit(Me) Me.Cursor = Cursors.WaitCursor Me.MdiParent = frmMain Dim i As Integer = 0 crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) crxTables = crxReport.Database.Tables For Each crxTable In crxReport.Database.Tables 'Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Database Name") = myDataBasePath & "\dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable crxReport.Database.Verify() crxReport.SQLQueryString = strSelectionfrm AxCRViewer1.ReportSource = crxReport AxCRViewer1.ViewReport() crxDataBase = Nothing crxTable = Nothing crxTables = Nothing crxReport = Nothing crxApp = Nothing Catch ex As Exception MsgBox(ex.ToString()) Finally Me.Cursor = Cursors.Default End Try End Sub ******************* actually i know that the error's occurs on the part where.. crxConnectionProperty = crxTable.ConnectionProperties() -->indexing or string name.. but i have just follow it from other forums that works for them.. anybody who have a good solutions about this error?? Please help... Im so frustated to figure it out myself... :(

    _ M C V 4 Replies Last reply
    0
    • V vbDiggerz

      anybody who knows or have an idea about this error in VB2005 and CrystalRport XI R2 and MS ACCESS? CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Here's my code: ************************ Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Public strSelectionfrm As String Public strCRSourcePath As String Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ChildFormAutoSizeFit(Me) Me.Cursor = Cursors.WaitCursor Me.MdiParent = frmMain Dim i As Integer = 0 crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) crxTables = crxReport.Database.Tables For Each crxTable In crxReport.Database.Tables 'Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Database Name") = myDataBasePath & "\dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable crxReport.Database.Verify() crxReport.SQLQueryString = strSelectionfrm AxCRViewer1.ReportSource = crxReport AxCRViewer1.ViewReport() crxDataBase = Nothing crxTable = Nothing crxTables = Nothing crxReport = Nothing crxApp = Nothing Catch ex As Exception MsgBox(ex.ToString()) Finally Me.Cursor = Cursors.Default End Try End Sub ******************* actually i know that the error's occurs on the part where.. crxConnectionProperty = crxTable.ConnectionProperties() -->indexing or string name.. but i have just follow it from other forums that works for them.. anybody who have a good solutions about this error?? Please help... Im so frustated to figure it out myself... :(

      _ Offline
      _ Offline
      _Damian S_
      wrote on last edited by
      #2

      vbDigger'z wrote:

      'Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath

      Should this say crxDataBase, not crxDataBasePath?

      ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

      V 1 Reply Last reply
      0
      • _ _Damian S_

        vbDigger'z wrote:

        'Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath

        Should this say crxDataBase, not crxDataBasePath?

        ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

        V Offline
        V Offline
        vbDiggerz
        wrote on last edited by
        #3

        Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath Should this say crxDataBase, not crxDataBasePath? ******* Yup!! actually i try it both... public crxDataBasePath as string = "D:\folder1\folder2\Database" For Each crxTable In crxReport.Database.Tables crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Initial Catalog") = "dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable ******** still the same error in that first line of, crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath .. CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" ********* and also please you may double check my code.. here it is.. *************************** Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Public strSelectionfrm As String Public strCRSourcePath As String Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ChildFormAutoSizeFit(Me) Me.Cursor = Cursors.WaitCursor Me.MdiParent = frmMain crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) crxTables = crxReport.Database.Tables For Each crxTable In crxReport.Database.Tables crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Initial Catalog") = "dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserIDxxxxxx" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPasswordxxxxx" Next crxTable crxReport.Database.Verify() crxReport.RecordSelectionF

        _ 1 Reply Last reply
        0
        • V vbDiggerz

          anybody who knows or have an idea about this error in VB2005 and CrystalRport XI R2 and MS ACCESS? CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Here's my code: ************************ Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Public strSelectionfrm As String Public strCRSourcePath As String Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ChildFormAutoSizeFit(Me) Me.Cursor = Cursors.WaitCursor Me.MdiParent = frmMain Dim i As Integer = 0 crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) crxTables = crxReport.Database.Tables For Each crxTable In crxReport.Database.Tables 'Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Database Name") = myDataBasePath & "\dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable crxReport.Database.Verify() crxReport.SQLQueryString = strSelectionfrm AxCRViewer1.ReportSource = crxReport AxCRViewer1.ViewReport() crxDataBase = Nothing crxTable = Nothing crxTables = Nothing crxReport = Nothing crxApp = Nothing Catch ex As Exception MsgBox(ex.ToString()) Finally Me.Cursor = Cursors.Default End Try End Sub ******************* actually i know that the error's occurs on the part where.. crxConnectionProperty = crxTable.ConnectionProperties() -->indexing or string name.. but i have just follow it from other forums that works for them.. anybody who have a good solutions about this error?? Please help... Im so frustated to figure it out myself... :(

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          This may be really stupid but try changing "User ID" to "UserID". I don't think it is the problem but I once ran up against something similar. If that does not work the change the string to an integer, you will probably need to verify the ordinal. There may be an enum somewhere!

          Never underestimate the power of human stupidity RAH

          V 1 Reply Last reply
          0
          • M Mycroft Holmes

            This may be really stupid but try changing "User ID" to "UserID". I don't think it is the problem but I once ran up against something similar. If that does not work the change the string to an integer, you will probably need to verify the ordinal. There may be an enum somewhere!

            Never underestimate the power of human stupidity RAH

            V Offline
            V Offline
            vbDiggerz
            wrote on last edited by
            #5

            Yah.. i've also try that myself in any way i can come up to solve that frustating code.. :( and experiment in many ways and also i tried to search other codes related to this and i find out they used the same crxTable.ConnectionProperties("Data Source") but then in vb6 code.. i think the code is something closely right but ther something missing or lacking in my code in that part.. i dont know what it is... :doh: im referring also to other forums but this site is the only one replying on my post... so hard... :(

            1 Reply Last reply
            0
            • V vbDiggerz

              anybody who knows or have an idea about this error in VB2005 and CrystalRport XI R2 and MS ACCESS? CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Here's my code: ************************ Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Public strSelectionfrm As String Public strCRSourcePath As String Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ChildFormAutoSizeFit(Me) Me.Cursor = Cursors.WaitCursor Me.MdiParent = frmMain Dim i As Integer = 0 crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) crxTables = crxReport.Database.Tables For Each crxTable In crxReport.Database.Tables 'Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Database Name") = myDataBasePath & "\dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable crxReport.Database.Verify() crxReport.SQLQueryString = strSelectionfrm AxCRViewer1.ReportSource = crxReport AxCRViewer1.ViewReport() crxDataBase = Nothing crxTable = Nothing crxTables = Nothing crxReport = Nothing crxApp = Nothing Catch ex As Exception MsgBox(ex.ToString()) Finally Me.Cursor = Cursors.Default End Try End Sub ******************* actually i know that the error's occurs on the part where.. crxConnectionProperty = crxTable.ConnectionProperties() -->indexing or string name.. but i have just follow it from other forums that works for them.. anybody who have a good solutions about this error?? Please help... Im so frustated to figure it out myself... :(

              C Offline
              C Offline
              ChandraRam
              wrote on last edited by
              #6

              vbDigger'z wrote:

              crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath

              Where is crxDataBasePath defined? Moreover, I think that the right hand side of the assignment will be evaluated to a boolean (crxTable.ConnectionProperties("Data Source") = crxDataBasePath) and this boolean will be assigned to crxConnectionProperty.

              V 1 Reply Last reply
              0
              • C ChandraRam

                vbDigger'z wrote:

                crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath

                Where is crxDataBasePath defined? Moreover, I think that the right hand side of the assignment will be evaluated to a boolean (crxTable.ConnectionProperties("Data Source") = crxDataBasePath) and this boolean will be assigned to crxConnectionProperty.

                V Offline
                V Offline
                vbDiggerz
                wrote on last edited by
                #7

                crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath Where is crxDataBasePath defined? Moreover, I think that the right hand side of the assignment will be evaluated to a boolean (crxTable.ConnectionProperties("Data Source") = crxDataBasePath) and this boolean will be assigned to crxConnectionProperty. ************ crxDataBasePath is defined from a vb module from the same vbproject and it is declare to be "public" so my other vbfiles or vbform can access it readily inside the project.. public crxDataBasePath as string = "D:\folder1\folder2\Database" i've also try to used this direct code: crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = "D:\folder1\folder2\Database" for me to test it... but still the same error... CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" ************************ For Each crxTable In crxReport.Database.Tables crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Initial Catalog") = "dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable ************** May be i try also "ChandraRam" suggestion.. thanks for everyone's participation and help..i really appreciation your help.. and please if anybody who can share their good idea there... please help... cause this CR reporting is not that so easy to figure it out specially to a bigenner like me.. thanks again in advance... God speed.. :)

                C 1 Reply Last reply
                0
                • V vbDiggerz

                  Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath Should this say crxDataBase, not crxDataBasePath? ******* Yup!! actually i try it both... public crxDataBasePath as string = "D:\folder1\folder2\Database" For Each crxTable In crxReport.Database.Tables crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Initial Catalog") = "dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable ******** still the same error in that first line of, crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath .. CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" ********* and also please you may double check my code.. here it is.. *************************** Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Public strSelectionfrm As String Public strCRSourcePath As String Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ChildFormAutoSizeFit(Me) Me.Cursor = Cursors.WaitCursor Me.MdiParent = frmMain crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) crxTables = crxReport.Database.Tables For Each crxTable In crxReport.Database.Tables crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Initial Catalog") = "dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserIDxxxxxx" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPasswordxxxxx" Next crxTable crxReport.Database.Verify() crxReport.RecordSelectionF

                  _ Offline
                  _ Offline
                  _Damian S_
                  wrote on last edited by
                  #8

                  Are you sure the "Data Source" property isn't expecting the full path AND filename of your database? eg: crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = "c:\databasepath\filename.mdb" ??

                  ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

                  V 1 Reply Last reply
                  0
                  • V vbDiggerz

                    crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath Where is crxDataBasePath defined? Moreover, I think that the right hand side of the assignment will be evaluated to a boolean (crxTable.ConnectionProperties("Data Source") = crxDataBasePath) and this boolean will be assigned to crxConnectionProperty. ************ crxDataBasePath is defined from a vb module from the same vbproject and it is declare to be "public" so my other vbfiles or vbform can access it readily inside the project.. public crxDataBasePath as string = "D:\folder1\folder2\Database" i've also try to used this direct code: crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = "D:\folder1\folder2\Database" for me to test it... but still the same error... CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" ************************ For Each crxTable In crxReport.Database.Tables crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Initial Catalog") = "dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable ************** May be i try also "ChandraRam" suggestion.. thanks for everyone's participation and help..i really appreciation your help.. and please if anybody who can share their good idea there... please help... cause this CR reporting is not that so easy to figure it out specially to a bigenner like me.. thanks again in advance... God speed.. :)

                    C Offline
                    C Offline
                    ChandraRam
                    wrote on last edited by
                    #9

                    Your are still using assignments like crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath This is similar to saying: x = y = 5 The result stored in x will be either true or false, depending upon whether value of y is 5. I hope I have clarified this...

                    V 1 Reply Last reply
                    0
                    • C ChandraRam

                      Your are still using assignments like crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath This is similar to saying: x = y = 5 The result stored in x will be either true or false, depending upon whether value of y is 5. I hope I have clarified this...

                      V Offline
                      V Offline
                      vbDiggerz
                      wrote on last edited by
                      #10

                      Your are still using assignments like crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath This is similar to saying: x = y = 5 The result stored in x will be either true or false, depending upon whether value of y is 5. ********************* actually, not really... i just made so many experimentation and also base on other post from the internet.. i've also try this code ************************** Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) For Each crxTable In crxReport.Database.Tables crxConnectionProperty = crxTable.ConnectionProperties.Item("Data Source") crxConnectionProperty.Value = "D:\Folder1\Folder2\DatabseFolder" crxConnectionProperty = crxTable.ConnectionProperties.Item("Initial Catalog") crxConnectionProperty.Value = "myDataBase.mdb" crxConnectionProperty = crxTable.ConnectionProperties.Item("User ID") crxConnectionProperty.Value = "xxxxxxxxx" crxConnectionProperty = crxTable.ConnectionProperties.Item("Password") crxConnectionProperty.Value = "xxxxxxxxx" Next crxTable crxReport.Database.Verify() crxReport.SQLQueryString = strSelectionfrm AxCRViewer1.ReportSource = crxReport AxCRViewer1.ViewReport() crxDataBase = Nothing crxTable = Nothing crxTables = Nothing crxReport = Nothing crxApp = Nothing Catch ex As Exception MsgBox(ex.ToString()) Finally Me.Cursor = Cursors.Default End Try End Sub ******************************* and still??? the same error... and i've also try this code and still the same error.. :( :(( ******************************* crxConnectionProperty = crxTable.ConnectionProperties.Item("Data Source") crxConnection

                      1 Reply Last reply
                      0
                      • _ _Damian S_

                        Are you sure the "Data Source" property isn't expecting the full path AND filename of your database? eg: crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = "c:\databasepath\filename.mdb" ??

                        ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

                        V Offline
                        V Offline
                        vbDiggerz
                        wrote on last edited by
                        #11

                        Are you sure the "Data Source" property isn't expecting the full path AND filename of your database? eg: crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = "c:\databasepath\filename.mdb" ********************* actually, not really... i just made so many experimentation also base on other post from the internet.. i've also try this code ************************** Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) For Each crxTable In crxReport.Database.Tables 'STILL ERROR OCCURED HERE "Invalid Index" also to following crxTable.ConnectionProperties.Item crxConnectionProperty = crxTable.ConnectionProperties.Item("Data Source") crxConnectionProperty.Value = "D:\Folder1\Folder2\DatabseFolder" crxConnectionProperty = crxTable.ConnectionProperties.Item("Initial Catalog") crxConnectionProperty.Value = "myDataBase.mdb" crxConnectionProperty = crxTable.ConnectionProperties.Item("User ID") crxConnectionProperty.Value = "xxxxxxxxx" crxConnectionProperty = crxTable.ConnectionProperties.Item("Password") crxConnectionProperty.Value = "xxxxxxxxx" Next crxTable crxReport.Database.Verify() crxReport.SQLQueryString = strSelectionfrm AxCRViewer1.ReportSource = crxReport AxCRViewer1.ViewReport() crxDataBase = Nothing crxTable = Nothing crxTables = Nothing crxReport = Nothing crxApp = Nothing Catch ex As Exception MsgBox(ex.ToString()) Finally Me.Cursor = Cursors.Default End Try End Sub ******************************* and still??? the same error... and i've also try this code and still the same error.. :( :(( ******************************* crxConnectionProperty = crxTabl

                        1 Reply Last reply
                        0
                        • V vbDiggerz

                          anybody who knows or have an idea about this error in VB2005 and CrystalRport XI R2 and MS ACCESS? CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" Here's my code: ************************ Public crxApp As CRAXDRT.Application Public crxReport As CRAXDRT.Report Public crxDataBase As CRAXDRT.Database Public crxTable As CRAXDRT.DatabaseTable Public crxTables As CRAXDRT.DatabaseTables Public crxConnectionProperty As CRAXDRT.ConnectionProperty Public strSelectionfrm As String Public strCRSourcePath As String Private Sub frmCrystalReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ChildFormAutoSizeFit(Me) Me.Cursor = Cursors.WaitCursor Me.MdiParent = frmMain Dim i As Integer = 0 crxApp = New CRAXDRT.Application crxReport = crxApp.OpenReport(strCRSourcePath, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault) crxTables = crxReport.Database.Tables For Each crxTable In crxReport.Database.Tables 'Note: The error occurs here crxConnectionProperty = crxTable.ConnectionProperties("Data Source") = crxDataBasePath crxConnectionProperty = crxTable.ConnectionProperties("Database Name") = myDataBasePath & "\dbEmployee.mdb" crxConnectionProperty = crxTable.ConnectionProperties("User ID") = "myUserID" crxConnectionProperty = crxTable.ConnectionProperties("Password") = "myPassword" Next crxTable crxReport.Database.Verify() crxReport.SQLQueryString = strSelectionfrm AxCRViewer1.ReportSource = crxReport AxCRViewer1.ViewReport() crxDataBase = Nothing crxTable = Nothing crxTables = Nothing crxReport = Nothing crxApp = Nothing Catch ex As Exception MsgBox(ex.ToString()) Finally Me.Cursor = Cursors.Default End Try End Sub ******************* actually i know that the error's occurs on the part where.. crxConnectionProperty = crxTable.ConnectionProperties() -->indexing or string name.. but i have just follow it from other forums that works for them.. anybody who have a good solutions about this error?? Please help... Im so frustated to figure it out myself... :(

                          V Offline
                          V Offline
                          vbDiggerz
                          wrote on last edited by
                          #12

                          what an ashame... I think, i know whats wrong with my vb project... its not on the code but the versioning of active x component CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" i've found out that my crystal report viewer in my printing form is version 11.5.0.0 (AxInterop.CrystalActiveXReportViewerLib11_5.dll) and i've import or add it from the project components from a specific folder of my project which i downloaded from the intenet before.. which has the functionalities of CRAXDRT.REPORT.SQLQUERYSTRING and CRAXDRT.REPORT.RECORDSELECTIONFORMULA and my installed crystal report developer XI R2 is using crystal report viewer 11.5.3700.0 which has only the functionality of CRAXDRT.REPORT.SELECTIONFORMULA so it means my project will use or refer to crystal report library of version 11.5.3700.0, because that is the only crystal report installed in my pc... that's why whenever i've sqlquerystring it gives the error CRAXDRT.ConnectionPropertiesClass.getItem(String Name) "Error: Invalid Index" because this can not find the functionality of SQLQueryString from CRAXDRT.Report v11.5.3700.0 but the there's something makes me puzzle? why does SQLQueryString from crystalreportviewer v11.5.3700.0 is missing? it is much higher version and must supposed to be stay there? this is crystalreportviewer11.5.3700.0 and it works using CRViewer11_5_37.selectionformula but when i type CRViewer11_5_37.SQLQueryString? there is no such .SQLQueryString and i can only find it at xraxdrt.report.SQLQueryString? ****************** Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class frmCrystalReport Public strSelectionfrm As String Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo) Try Dim myTableLogOnInfos As TableLogOnInfos = Me.AxCRViewer1.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos myTableLogOnInfo.ConnectionInfo = myConnectionInfo Next Catch ex As Exception MsgBox(ex.ToString()) End Try End Sub Private Sub ConfigureCrystalReports() Try Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo() myConnectionInfo.DatabaseName = DataSource myConnectionInfo.UserID = "admin" myConnectionInfo.Password = "xxxxx" myConnectionInfo.ServerName = "xxx.mdb" 'Your filter formula co

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups