Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Automation Error: The Object Invoked Has Disconnected From Its Clients


Does anyone know what this error means or why it occurs???!

"Automation Error: The Object invoked has disconnected from its clients"




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Automation Error. The Object Invoked Has Disconnected From Its Clients
I have one program. It is working without any problem. But when we create a package and install it, the exe file works.

But in some time it shows an error that ‘Automation Error. The object invoked has disconnected from its clients.


It fails every time when we open one or two particular forms.

But other forms are working properly.

But these specified forms are working well when we open this from VB itself (Run program from VB). Then problem is only when open the installed program in the same system or any other system(ie. Exe pgm in another folder )

This is windows app. Program. But the database is in server connecting with DSN. At the same time we are connecting with another database in the client system itself.

Please give me a solution.

Automation Error -2147417848 The Object Invoked Has Disconnected From Its Clients
I've seen several posts about this but non that really help!

I get this only when running the program as an executable..... Never in Visual Basic...

I've isolated it to one routine, but can't figure out what this message is trying to tell me... I trap the error now, and the program seems to continue to work just fine after the error... but I really think I should track it down!

Getting Automation Error " The Object Invoked Has Disconnected From Its Clients
I m getting automation error whenever i m trying to retrieve more than 500 items from a grid in Visual Basic.I m using a MSH Flexi Grid.

Suggestions are invited......

The Object Invoked Has Disconnected From Its Clients
Dear all,

I'm face this error message when I run my application at PC with OS win2000.
It is ok when it run on OS win98 and winXP.
I find out it keep on looping at the code (color in blue) when the step into the char * (color in red)

I have go thru some of the previous Thread, it seem not really same case.

Is there any suggestion? anyone face the same problem too?

Thank you
Regards
Eric

Code attach

Sub PrintSinglePremNotes()

On Error GoTo errorhandler:
' English

CPrint.pPrint
CPrint.pPrint "Notes:", 0.5, False
Dim a As String
Dim B As String
Dim c As String
Dim d As String
Dim e As String


a = "The projected benefit above are purely for illustration purposes only. The assumption on the range .................lustrated to be earned on meant to "
B = "represent or be indicative of..................returns of the fund(s). The may go down as well as up. "
c = "The value of the fund might fall below the accumulated premium paid. If the policy is ............................you may get less than the amount premium paid."
e = "* In the event of Death or Total Permanent for all funds available to the plan."
d = a & B & c
CPrint.pPrint d, 0.5, False
CPrint.pPrint e, 0.5, False

' Malay
CPrint.FontItalic = True
CPrint.pPrint
CPrint.pPrint "Nota-nota:", 0.5, False

Dim z As String
Dim y As String
Dim x As String
Dim w As String
z = "Unjuran faedah-faedah di atas hanya unt.....................tujuan ilustrasi sahaja. dan tidak bermaksud "
y = "untuk mewakili atau sebagai petunjuk bagi pulangan sebenar dana(dana-dana). ...............................................yang dilustrasikan TIDAK mewakili unit mungkin jatuh dan naik. Nilai "
x = "dana mungkin jatuh di bawah premium terkumpul dibayar."

w = z & y & x
CPrint.pPrint w, 0.5, False

CPrint.pPrint "* ", 0.5, True

CPrint.pPrint "Sekiranya berlaku Kematian atau Hilang Upaya Menyeluruh dan Kekal, pembayaran faedah ditentukan sebagai " & _
"Tergabung bagi kesemua dana yang tersedia " & _
"dalam pelan.", , False
CPrint.FontItalic = False

Exit Sub

errorhandler:
MsgBox err.Description & err.HelpFile

------

Public Sub pPrint(Optional ByVal PrintVar As String = vbNullString, _
Optional ByVal LMargin As Single = -1, _
Optional SameLine As Boolean = False, _
Optional ByVal RMargin As Single = -1)


If PrintVar = vbNullString Then
'/* Empty String */
Else
If LMargin = -1 Then LMargin = CurrentX
If RMargin = -1 Then
If GetTextWidth(PrintVar) + LMargin > PgWidth - 0.3 Then
pMultiline PrintVar, LMargin, PgWidth - 0.5, , SameLine
Exit Sub
End If
Else
If GetTextWidth(PrintVar) + LMargin > RMargin Then
pMultiline PrintVar, LMargin, RMargin, , SameLine
Exit Sub
End If
End If
End If

If LMargin >= 0 Then CurrentX = LMargin

If SameLine Then
If PrintFlag Then
Printer.Print PrintVar;
Else
pageobject.Add_Font objPrint.FontName, objPrint.FontSize, objPrint.ForeColor, objPrint.FontBold, objPrint.FontItalic, objPrint.FontUnderline, objPrint.FontStrikethru, objPrint.FontTransparent
pageobject.Add_Text PrintVar, objPrint.CurrentX * 1440, objPrint.CurrentY * 1440
objPrint.Print PrintVar;
End If
Else
If PrintFlag Then
Printer.Print PrintVar
Else
pageobject.Add_Font objPrint.FontName, objPrint.FontSize, objPrint.ForeColor, objPrint.FontBold, objPrint.FontItalic, objPrint.FontUnderline, objPrint.FontStrikethru, objPrint.FontTransparent
pageobject.Add_Text PrintVar, objPrint.CurrentX * 1440, objPrint.CurrentY * 1440
objPrint.Print PrintVar
End If
End If
End Sub

Object Invoked Has Disconnected From Its Clients
We are developing an activeX dll that calls a C dll using the "Private Declare Function" method to do LDAP calls for authentication. On 2 of our 4 servers the first call works but subsequent calls throw the error "Object Invoked Has Disconnected From Its Clients".

Any ideas on what could be causing this?

All the servers are w2k

thanks,

The Object Invoked Has Disconnected From Its Clients
Hi,

I have one application (standard exe) that opens one dll (with forms, classes inside it).

After the dll is called I get the main form (from the dll). However, if I click in anything on it I get this error message: "Run-time error - 2147417848 The object invoked has disconnected from its clients"

the code I´m using is this:

On the main exe:

Dim con As ADODB.Connection
Dim lcl_prof As Prof.CLS_Start

Set lcl_prof = New Profissao.CLS_Start
Set con = New ADODB.Connection
con.Open "Provider = MSDAORA.1; Data source = bdgrc; user id = userid; password = userpw;"
lcl_prof.ligacaoBD con  'passing the connection by ref
End Sub


On the dll: (only the begining code)

Public sub ligacaoBD(ByRef con As ADODB.Connection)

    Set gbl_conPri = New ADODB.Connection
    Set gbl_conPri = con
    FRM_prof.Show
        
End Sub

After the FRM_prof appears I will call another form... etc...like an independent application.

However I receive that error :(

Any help is appreciated

Thank you


The Object Invoked Has Disconnected From Its Clients
Hi,
I have this problem:
My program does report with Crystal Report, and I got a procedure that does a bunch of report.
Every client using the program is connected to a DLL server.
Let's say I have to machines.
1)When they both run just a single report it works fine.
2) if I run a batch report on one machine and either another batch or a very long single report on the other machine I get this error : The object invoked has disconnected from its clients.

I am not sure if it's a CR issue or something else, but for info I use CR9.

Anyone ever got that problem?
Thanks!

The Object Invoked Has Disconnected From Its Clients.
When I call a C++ COM Object from a VB COM object I get the following message:

Automation error
The object invoked has disconnected from its clients.

However if I call the same object with an EXE it works perfectly.

I have written both COM+ objects and they seem to be ok

Any help??

Cheers

Rob

The Object Invoked Has Disconnected From Its Clients - UltraGrid / VB6
Hi,

I'm using Infragistics UltraGrid. When I try and use its Print function I
Get this error message:
The object invoked has disconnected from its clients

This only seems too happen when running on a Win2003 Server (fully upto date
with patches). If I run on a Win XP then no error is recived.

I have found many articles where this error could happen ie calling the
crystal reports control, Office Automation etc. I've also seen articles
where to update MDAC.

I've looked on Infragistics forums although someone has asked about this
problem no solution was given. Also UltraGrid 2 is no longer support by
Infragistics

Anyone come accross this using this Grid?
I only have one line of code and it's:
Code:grdStockBalReconciliation.PrintPreview True

This should then bring up a print preview window.


Thanks in advance
Darren

P.S IGULTRAGRID20.OCX requires IGPRINT.DLL to beable to print.

The Object Found Has Been Disconnected From Its Clients.. Automation Error -214714784
Hello ,

I have encountered a problem of system error -2147147848
Automation Error..
The Object found has been disconnected from its clients.

Also this is while trying to open a crystal report via a VB Application

and while registering with the server
regsvr32 crpe32.dll

The error message

crpe32.dll was loaded, but the DLLRegisterServer entry point was not found.

DllRegisterServer may not be exported, or a curropt version of crpe32.dll may be in the memory. Consider using PView to detect and remove it.

If anyone has a solution please post it over...

Many Thanks,
Amit

Object Invoked Disconnected From Its Client Error While Importing Excel File ?
sir,
i am importing a excel file
i displayed the sheet names in a list box,while select the sheet ,that particular sheet will be imported

the error is at the time of processing the file,updating the excel file occurs

steps
open the file ,import the sheet
now open the excel file ,modify it and save,dont close
now click the updated sheet to import
now i am getting the error
as"object invoked disconnected from its client"
plz any can help me to solve this,
its very urgent!


senthil
 

coding sample: dont consider commented lines

Code:
#Region "common variables"
    Private objServer As New Blaze.Consumption.BackOffice.ConsumptionServer
    Private objBOBOMGenerator As New Blaze.Consumption.BackOffice.BOBOMGenerator
    Private objBOMGenerator As New Blaze.Consumption.Facade.BOMGenerator
    Private objIteminfo As New Blaze.Consumption.Facade.ItemDetails

    Dim newRow As DataRow
    Private bomId As String
    Private fileName As String
    Private dsBOMImport As DataSet
    Private formDisplay As Boolean

    Private xlApp As Excel.Application
    Private xlWB As Excel.Workbook
    Private xls As Excel.Worksheet
    Private table As New DataTable
#End Region


#Region "populate category"
    Private Sub PopulateCategory()
        Dim dsCategory As DataSet
        dsCategory = objServer.FetchDataSet("Con_SelectCategoryMaster", "Category")
        If dsCategory.Tables(0).Rows.Count > 0 Then
            formDisplay = False
            cmbCategory.DropDownStyle = ComboBoxStyle.DropDownList
            Me.cmbCategory.DataSource = dsCategory.Tables("Category")
            Me.cmbCategory.DisplayMember = "Name"
            Me.cmbCategory.ValueMember = "Category ID"
            Me.cmbCategory.SelectedIndex = -1
        Else
            MessageBox.Show("Category Does not exists", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
            formDisplay = True
            Exit Sub
        End If
    End Sub
#End Region

#Region "Form Load"
    Private Sub frmBOMImport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Me.InitializeDataGrid()
            Me.gbItemDetails.Enabled = False
            Me.gbView.Visible = True
            Me.gbAdd.Visible = False
            Me.dgItemList.ReadOnly = True
            Me.lblMessage.Text = "Select The BOM Excel File To Import"
            Me.PopulateCategory()

            table.Columns.Clear()
            table.Columns.Add("ItemID")
            table.Columns.Add("Description")
            table.Columns.Add("Unit")
            table.Columns.Add("Quantity")

            If Me.CanAdd = False Then
                Me.butImport.Enabled = False
            Else
                Me.butImport.Enabled = True
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message, Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        Finally
            Me.gbView.Enabled = False
        End Try
    End Sub
#End Region

#Region "Import BOM Details"
    Private Sub butImport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butImport.Click
        ' Create a dialog box to find the excel file
        Dim dlgBOMImport As New Windows.Forms.OpenFileDialog
        Dim intRows, intCols As Integer
        'Dim r, c As Integer
        Try
            dlgBOMImport.Filter = "Excel Files (*.xls)/*.xls"
            dlgBOMImport.FilterIndex = 0
            dlgBOMImport.ShowDialog()
            'get the file name
            fileName = dlgBOMImport.FileName
            ' Dim fileinfo As New System.IO.FileInfo(strFileName)
            If fileName.Trim.Length <> 0 Then
                xlApp = New Excel.Application
                Try
                    'Dim fi As New System.IO.FileInfo(fileName)
                    'fi.Open(System.IO.FileMode.Open)
                        xlWB = xlApp.Workbooks.Open(fileName:=fileName, [ReadOnly]:=True)
                        xls = xlWB.Sheets(1)
                Catch ex As Exception
                    MessageBox.Show("File Already opened,Plz Close and Try again to Open", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
                    Exit Sub
                End Try

                If Convert.ToString(CType(xls.Cells(3, 1), Excel.Range).Text).Trim = "IDNR" And Convert.ToString(CType(xls.Cells(3, 2), Excel.Range).Text).Trim = "Description" And Convert.ToString(CType(xls.Cells(3, 3), Excel.Range).Text).Trim = "Unit" Then
                    'MessageBox.Show("matches")
                    Me.lblMessage.Text = "File Matches"

                    'gets the bomid to checkwhether it exists or not in bomdetails
                    bomId = CType(xls.Cells(1, 2), Excel.Range).Text
                    objBOMGenerator.BOMId = bomId
                    objBOMGenerator.Operation = Facade.OperationType.Check
                    objBOMGenerator = objServer.BOMService(objBOMGenerator)
                    If objBOMGenerator.RetVal = 0 Then
                        'MessageBox.Show("bomid not exists")
                        Me.lblMessage.Text = "BOMID not Exists,So Creating New BOM ID"
                        'bomid not exists,so add new bom id in bommaster
                        objBOMGenerator.BOMId = bomId
                        objBOMGenerator.Operation = Facade.OperationType.AddBOMMaster
                        objBOMGenerator = objServer.BOMService(objBOMGenerator)
                        If objBOMGenerator.Result = Facade.ResultType.Success Then
                            'MessageBox.Show("bom id added")
                            Me.gbSelectFile.Enabled = False
                            objBOMGenerator.BOMId = bomId
                            dsBOMImport = objServer.FetchBOMDetails(objBOMGenerator, "BOMImport")
                            Me.dgView.DataSource = dsBOMImport.Tables("BOMImport")
                            Me.gbView.Visible = False
                            Me.gbAdd.Visible = True
                            Me.gbAdd.Enabled = False
                            Call Me.getExcelData()
                        End If
                    Else
                        'MessageBox.Show("bomid exists")
                        'bom id already exists,so fetch all the details in bomdetails and show it in datagrid
                        objBOMGenerator.BOMId = bomId
                        dsBOMImport = objServer.FetchBOMDetails(objBOMGenerator, "BOMImport")
                        Me.dgView.DataSource = dsBOMImport.Tables("BOMImport")
                        Me.gbView.Visible = True
                        Me.gbView.Enabled = True
                        'asking to update the bomid
                        Me.lblMessage.Text = "Do You Want To Update The BOM Details ?"
                        If (MessageBox.Show("BOM Details Already Exists,Do You want to update the BOM details,Surely ?", Me.MessageTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
                            Me.gbSelectFile.Enabled = False
                            Me.lblMessage.Text = "Clicked Yes"
                            Me.gbView.Visible = False
                            Me.gbAdd.Visible = True
                            Me.gbAdd.Enabled = False
                            'if yes,delete the items from bomid
                            objBOMGenerator.BOMId = bomId
                            objBOMGenerator.Operation = Facade.OperationType.DeleteBOMDetails
                            objBOMGenerator = objServer.BOMService(objBOMGenerator)
                            Call Me.getExcelData()
                        Else
                            Me.gbView.Enabled = False
                            If Not dsBOMImport.Tables("bomimport") Is Nothing Then
                                dsBOMImport.Tables("bomimport").Clear()
                            End If
                            If Not dsBOMImport.Tables("import") Is Nothing Then
                                dsBOMImport.Tables("import").Clear()
                            End If
                            Me.dgView.DataBindings.Clear()
                        End If
                    End If

                Else
                    Me.lblMessage.Text = "Select The Perfect File"
                    MessageBox.Show("Please Select The Correct File", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
                End If
            Else
                'MessageBox.Show("Select the File", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
                'Me.lblMessage.Text = "Select The File"
            End If
        Catch ex As Exception
            MessageBox.Show(ex.Message, Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        Finally
        End Try
    End Sub
#End Region

#Region "Get Excel Data"
    Sub getExcelData()
        Dim listCount As Integer = 0
        Dim adpBOMImport As OleDb.OleDbDataAdapter
        Dim comBOMImport, conBOMImport As String
        'convert the excel data as dataset
        Convert.ToString(CType(xlWB.Sheets.Item(1), Excel.Worksheet).Name)
        comBOMImport = " SELECT * FROM " & "[" & Convert.ToString(CType(xlWB.Sheets.Item(1), Excel.Worksheet).Name) & "$]"
        conBOMImport = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source =" + fileName + ";Extended Properties=Excel 8.0"
        Dim conn As New OleDb.OleDbConnection(conBOMImport)
        adpBOMImport = New OleDb.OleDbDataAdapter(comBOMImport, conn)
        adpBOMImport.Fill(dsBOMImport, "import")
        Dim count As Integer
        count = dsBOMImport.Tables("import").Rows.Count

        For i As Integer = 2 To count - 1
            Me.lblMessage.Text = "Checks item ID Exists or Not"
            'checks whether the item id is exists or not

            'If Convert.ToString(dsBOMImport.Tables("import").Rows(i).Item(0)).Trim.Length = 0 Then
            If Not (dsBOMImport.Tables("import").Rows(i).Item(0) Is DBNull.Value) Then
                objiteminfo.ItemId = dsBOMImport.Tables("import").Rows(i).Item(0)
                objiteminfo.Operation = Facade.OperationType.Check
                objiteminfo = objServer.ItemService(objiteminfo)
                If objiteminfo.RetValue = 0 Then
                    'MessageBox.Show("Item ID Not Exists,So create", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
                    'MessageBox.Show("item id not exists,so create")
                    'Me.lstBOM.Items.Add(Convert.ToString(dsBOMImport.Tables("import").Rows(i).Item(0)))
                    newRow = table.NewRow
                    newRow("ItemId") = dsBOMImport.Tables("import").Rows(i).Item(0)
                    newRow("Description") = dsBOMImport.Tables("import").Rows(i).Item(1)
                    newRow("Unit") = dsBOMImport.Tables("import").Rows(i).Item(2)
                    newRow("Quantity") = dsBOMImport.Tables("import").Rows(i).Item(3)
                    table.Rows.Add(newRow)
                    listCount += 1
                Else
                    'MessageBox.Show("item id exists so save")
                    Me.lblMessage.Text = "Item Id Exists"
                    'item id exists already,so save it
                    'before save check the itemid already exists in bomdetails for a particular bom id
                    objBOMGenerator.ItemId = dsBOMImport.Tables("import").Rows(i).Item(0)
                    objBOMGenerator.BOMId = bomId
                    objBOMGenerator.Operation = Facade.OperationType.checkBOMIDItemIDExistence
                    objBOMGenerator = objServer.BOMService(objBOMGenerator)
                    If objBOMGenerator.RetVal = 0 Then
                        objBOMGenerator.ItemId = dsBOMImport.Tables("import").Rows(i).Item(0)
                        objBOMGenerator.Qty = dsBOMImport.Tables("import").Rows(i).Item(3)
                        objBOMGenerator.BOMId = bomId
                        objBOMGenerator.Operation = Facade.OperationType.AddBOMDetails
                        objBOMGenerator = objServer.BOMService(objBOMGenerator)
                        If objBOMGenerator.Result = Facade.ResultType.Failure Then
                            Throw New Exception(objBOMGenerator.Exception)
                        End If
                    End If
                End If
            End If
        Next
        If listCount <> 0 Then
            gbAdd.Enabled = True
            MessageBox.Show(" Items saved successfully except Items Listed ", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
            Me.dgItemList.DataSource = table
            Me.lblMessage.Text = "Item details which Not Exists are listed,select the Item to Create and save"
        Else
            MessageBox.Show(" Items saved successfully", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
            Me.lblMessage.Text = "Item ID Saved Successfully"
            Me.gbAdd.Enabled = False
            Me.gbSelectFile.Enabled = True
            dsBOMImport.Tables("bomimport").Clear()
            dsBOMImport.Tables("import").Clear()
        End If
    End Sub

   
#Region "Add BOM ITEM DETAILS"
    Private Sub butAdd_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butAdd.Click
        If Me.dgItemList.CurrentRowIndex = -1 Then
            MessageBox.Show("Select The Item Code/Item UnAvailable", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End If
        Me.txtItemId.Text = table.Rows(Me.dgItemList.CurrentRowIndex).Item(0)
        Me.txtDesc.Text = table.Rows(Me.dgItemList.CurrentRowIndex).Item(1)
        Me.txtUnitName.Text = table.Rows(Me.dgItemList.CurrentRowIndex).Item(2)
        Me.txtItemId.Enabled = False
        Me.txtDesc.Enabled = False
        Me.txtUnitName.Enabled = False
        Me.gbItemDetails.Enabled = True
        Me.gbAdd.Enabled = False

    End Sub

    
#Region " Create New Item"
    Private Sub butCreate_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butCreate.Click
        Try
            If Me.cmbCategory.SelectedIndex = -1 Then
                Me.lblMessage.Text = "Please,Select the Category"
                MessageBox.Show("Please select the Category ", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
                Me.cmbCategory.Focus()
                Exit Sub
            End If


            If (txtUnitPrice.Text.Trim() = "") Then
                Me.lblMessage.Text = "Please,Enter The Unit Price"
                MessageBox.Show("Please enter the Unit Price", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning)
                txtUnitPrice.Focus()
                Exit Sub
            ElseIf txtUnitPrice.Text = "." Then
                Me.lblMessage.Text = "Please,Enter The Unit Price"
                MessageBox.Show("Please enter the Unit Price", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning)
                txtUnitPrice.Focus()
                Exit Sub
            ElseIf (Convert.ToDouble(txtUnitPrice.Text.Trim()) = 0) Then
                Me.lblMessage.Text = "Please,Enter The Unit Price"
                MessageBox.Show("Please enter the Unit Price", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning)
                txtUnitPrice.Clear()
                txtUnitPrice.Focus()
                Exit Sub
            ElseIf (Len(txtUnitPrice.Text) > 4 And InStr(txtUnitPrice.Text, ".") = 0) Then
                Me.lblMessage.Text = "Please,Enter The Unit Price"
                MessageBox.Show("Please,Enter The valid unit price", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning)
                txtUnitPrice.Clear()
                txtUnitPrice.Focus()
                Exit Sub
            ElseIf (InStr(txtUnitPrice.Text, ".") > 5) Then
                Me.lblMessage.Text = "Please,Enter The Unit Price"
                MessageBox.Show("Please,Enter The valid unit price", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning)
                txtUnitPrice.Clear()
                txtUnitPrice.Focus()
                Exit Sub

            End If


            If Me.txtArtNo.Text.Trim.Length = 0 Then
                objiteminfo.ArticleNumber = Nothing
            Else
                objiteminfo.ArticleNumber = Convert.ToInt16(Me.txtArtNo.Text.Trim)
            End If

            objiteminfo.ItemId = Convert.ToString(Me.txtItemId.Text.Trim)
            objiteminfo.CategoryId = Me.cmbCategory.SelectedValue
            objiteminfo.ItemDesc = Convert.ToString(Me.txtDesc.Text.Trim)
            objiteminfo.UnitOfMeasure = Convert.ToString(Me.txtUnitName.Text.Trim)
            objiteminfo.UnitPrice = Convert.ToDecimal(Me.txtUnitPrice.Text.Trim)

            objiteminfo.Operation = Facade.OperationType.Add
            objiteminfo = objServer.ItemService(objiteminfo)
            If objiteminfo.Result = Facade.ResultType.Success Then
                objBOMGenerator.ItemId = table.Rows(Me.dgItemList.CurrentRowIndex).Item(0)
                objBOMGenerator.Qty = table.Rows(Me.dgItemList.CurrentRowIndex).Item(3)
                objBOMGenerator.BOMId = bomId
                objBOMGenerator.Operation = Facade.OperationType.AddBOMDetails
                objBOMGenerator = objServer.BOMService(objBOMGenerator)
                If objBOMGenerator.Result = Facade.ResultType.Success Then
                    MessageBox.Show("saved successfully", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
                    Me.lblMessage.Text = "Item ID Saved Successfully"
                    table.Rows(Me.dgItemList.CurrentRowIndex).Delete()
                    Me.gbItemDetails.Enabled = False
                    Me.gbAdd.Enabled = True

                    Me.cmbCategory.SelectedIndex = -1
                    Me.txtUnitPrice.Text = ""
                    Me.txtArtNo.Text = ""
                Else
                    Throw New Exception(objBOMGenerator.Exception)
                End If
            Else
                Throw New Exception(objiteminfo.Exception)
            End If

        Catch ex As Exception
            MessageBox.Show(ex.Message, Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        Finally
        End Try
    End Sub
  #End Region

#Region "Cancel Options"
    Private Sub butSelectCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butSelectCancel.Click
        If Not (xlWB Is Nothing) Then xlWB.Close(False)
        xlWB = Nothing
        If Not (xlApp Is Nothing) Then xlApp.Quit()
        xlApp = Nothing
        xls = Nothing
        Me.Close()
        'If Not (dsBOMImport.Tables("bomimport") Is Nothing) Then
        ' dsBOMImport.Tables("bomimport").Clear()
        'End If
        'If Not (dsBOMImport.Tables("import") Is Nothing) Then
        ' dsBOMImport.Tables("import").Clear()
        'End If
        Me.dgView.DataBindings.Clear()
        table.Dispose()
        table.Columns.Clear()
        table.Rows.Clear()
    End Sub
    Private Sub butAddCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butAddCancel.Click
        Dim dsBOMImportCheck As New DataSet
        objBOMGenerator.BOMId = bomId
        dsBOMImportCheck = objServer.FetchBOMDetails(objBOMGenerator, "BOMImport")
        If dsBOMImportCheck.Tables("BOMImport").Rows.Count = 0 Then
            MessageBox.Show("Add atleast one item to exit", Me.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
            Exit Sub
        End If
        dsBOMImportCheck.Tables("BOMImport").Clear()
        Me.gbAdd.Visible = False
        Me.gbView.Visible = True
        Me.gbView.Enabled = False
        Me.gbSelectFile.Enabled = True
        dsBOMImport.Tables("import").Clear()
        table.Rows.Clear()
        Me.dgItemList.DataBindings.Clear()
        dsBOMImport.Tables("bomimport").Clear()
        Me.dgView.DataBindings.Clear()
        Me.lblMessage.Text = "Select Next file To Import"
    End Sub
    Private Sub butSavecancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butSavecancel.Click
        Me.lblMessage.Text = "Select The Next Item"
        Me.gbItemDetails.Enabled = False
        Me.gbAdd.Enabled = True
        Me.cmbCategory.SelectedIndex = -1
        Me.txtUnitPrice.Text = ""
        Me.txtArtNo.Text = ""
    End Sub
#End Region

#Region "KeyPress Events"
    Private Sub txtArtNo_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtArtNo.KeyPress
        If Asc(e.KeyChar) = 13 Then
            Me.txtUnitPrice.Focus()
        End If
        If (Len(txtArtNo.Text) >= 8 And Asc(e.KeyChar) <> 8) Then
            e.Handled = True
            Exit Sub
        End If
        If Not ((Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57) Or Asc(e.KeyChar) = 8) Then
            e.Handled = True
        End If
    End Sub
    Private Sub txtUnitPrice_KeyPress1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtUnitPrice.KeyPress
        If Asc(e.KeyChar) = 13 Then
            Me.butCreate.Focus()
        End If
        If (Len(txtUnitPrice.Text) >= 8 And Asc(e.KeyChar) <> 8) Then
            e.Handled = True
            Exit Sub
        End If

        'to accept maximum 5 digits before decimal part
        If (Len(txtUnitPrice.Text) = 4 And InStr(txtUnitPrice.Text, ".") = 0) Then
            If (Asc(e.KeyChar) <> 46) Then
                e.Handled = True
            End If
        End If

        If Not ((Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57) Or Asc(e.KeyChar) = 8 Or Asc(e.KeyChar) = 32 Or Asc(e.KeyChar) = 46) Then
            e.Handled = True
        End If
        If InStr(txtUnitPrice.Text, ".") > 0 Then
            If Asc(e.KeyChar) = 46 Then
                e.Handled = True
                Exit Sub
            End If
            If (Len(txtUnitPrice.Text) - 3) = InStr(txtUnitPrice.Text, ".") And Asc(e.KeyChar) <> 8 Then
                e.Handled = True
                Exit Sub
            End If
        End If
    End Sub
#End Region

#Region "Form Activate"
    Private Sub frmBOMImport_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated

        If Me.formDisplay = True Then
            Me.Close()
        End If

    End Sub
#End Region

End Class





Edited by - Geof on 7/13/2006 6:42:59 AM

Automation Error (object Invoked ....)
hi ,,


i've created a system using VB6 .. make an installation package and tried to install it on other computers .. it worked on some .. but on soem computers i get thsi error when i try to insert data in the system ..

run-time error 2147417848
automation error
the object invoked from its clients

*note: am using DataGrids


Automation Error -2147417848 The Object Invoked...
Hi everybody !

I installed my app on three machines. On one machine when I start the app, I received this message:

Automation Error -2147417848 The object invoked has disconnected from its clients

I searched on this forum and I dont find a solution ? Please help me !

Thanks !

Automation Error -2147417848 The Object Invoked Has....
Hi everybody !

I installed my app on three machines. On one machine when I start the app, I received this message:

Automation Error -2147417848 The object invoked has disconnected from its clients

I searched on this forum and I dont find a solution ? Please help me !

Thanks !

Graph Report In Crystal Reports 8.5 Shows Error (Automation Error. The Object Invoked Has Disconnect
Dear All,

while calling a report containing graph from VB 6.0 I found following error,

"Automation Error. The object invoked has disconnected from its clients"

but when I install crystal reports 8.5 on client machine then the error disappears.

can anybody advice?

Best Regards,Shahzad Anwar 92-345-8237099

Object Invoked Has Disconnected
Hey guys first timer

I know one you guys can answer this one

This code works:

Code:
Sub UserForm_Click()
Dim testcl As ClsMonteCarlo
Dim arrayinput() As Long
ReDim arrayinput(30)
arrayinput(0) = 12
Set testcl = New ClsMonteCarlo
testcl.Init 2, 33, 4, 5
testcl.a_input = arrayinput
End Sub


'ClsMonteCarlo

Option Explicit
Public m_outlay As Integer
Public m_exo As Long
Public m_edoarray As Long
Public m_duration As Long
Public m_discount As Long
Private m_arrayinput() As Long

Public Property Let a_input(a_input() As Long)
m_arrayinput = a_input
End Property

Public Property Get a_input() As Long()
a_input = m_arrayinput
End Property

Friend Sub Init(outlay As Integer, exo As Long, _
duration As Long, discount As Long)
Me.m_outlay = outlay
Me.m_exo = exo
Me.m_duration = duration
Me.m_discount = discount
End Sub
but in the spirt of making code more user friendly, i want to put a_input in the init sub. I have tried this but get "object invoked has disconnected from its clients"

Here is my new code:

Code:
Option Explicit

Sub UserForm_Click()

Dim testcl As ClsMonteCarlo
Dim arrayinput() As Long
ReDim arrayinput(30)
arrayinput(0) = 12
Set testcl = New ClsMonteCarlo
testcl.Init 2, 33, 4, 5, arrayinput

End Sub

'ClsMonteCarlo

Option Explicit

Public m_outlay As Integer
Public m_exo As Long
Public m_edoarray As Long
Public m_duration As Long
Public m_discount As Long
Private m_arrayinput() As Long

Public Property Let a_input(bValue() As Long)
m_arrayinput = a_input
End Property

Public Property Get a_input() As Long()
a_input = m_arrayinput
End Property

Friend Sub Init(outlay As Integer, exo As Long, _
duration As Long, discount As Long, arrayinput() As Long)
Me.m_outlay = outlay
Me.m_exo = exo
Me.m_duration = duration
Me.m_discount = discount
Me.a_input = arrayinput
End Sub

I'm sure its simple thanks. This forum is great
Edit by Moderator: Please use the [vb][/vb] tags when you post code. Reply to or edit this post to see how.

Object Invoked Has Disconnected......
Hi Gurus,
I am facing a problem while running my VB project. Whenever I run a few data reports in succession (sometimes running them after this error occurs) I get the following runtime automation error:
The Object invoked has disconnected from its clients.

The project after this message closes if I chose to end and not debug. If I debug and run it again it gives message that the report is already called or something.

Backend: password protected MSAccess The connection object is a global one returned from a data environment.

I am not able to make out what is this error and how to get rid of it. An early help will be appreciated.

80010108 Object Invoked Has Disconnected...
When running the Package & Deployment on my project, I'm getting this error 80010108: The object invoked has disconnected from its clients.

I've researched it and it appears to be a problem with Crystal Reports. I've found the fix (editing the Crystl32.dep file), but I'm running XP pro and I can't find that file anywhere.

Can someone please help me with this? Thanx in advance.

~m.

Object Invoked Has Disconnected From The Client
I have just recently transfered by project to an XP machine (Machine A) from a my development machine (win2000, crystal reports 8.5, Acess 2000 but using access97 database, VB6). The Machine A is connected to a dot matrix printer and a laser printer. Reports printed using laser printer is OK but reports using dot matrix is not. When i run the EXE, the error
"Object invoked has disconnected from the client"
follow by
"Memory at location XXX cant be written at location XXX" (the error was long so i cant remember the exact words)

appears. My program uses 3rd party component by Data Widgets2.0... so.. when i run the PROJECT file, the error
"Data Widgets- You dont have license to use this software" etc

appears and the project crash immediately.This only happens when i try to print anything using dot matrix. Reports can be printed fine using laser jet.

So is this incompatibility of Data widgets with XP? or with Dot matrix? or is it problem with the printer driver? or is it incompatibility of crystal reports with dot matrix. i know for sure this error only comes out if i print using dot matrix.
can some please help me to solve this? i couldnt figure out what is the problem. and yes i have installed mdac 2.0 til mdac8.0 and have updated the XP

Object Invoked Is Disconnected From Client
Currently I was using 'Package and Deployment wizard' of VB 6.0.
After clicking the 'Finish' button the following error occured

'Automation error. Object invoked has disconnected from client'

could you please give me the cause and solution for this problem?

Thank you

"The Object Invoked Has Disconnected From Its Client" Autocad VBA
Hi,                                                
I am getting the error message      (err.number -2147417848) in AUTOCAD VBA program, while traversing each layout in autocad drawing I m converting the current layout to .eps and then into .pdf. I am able to create the PDF for first layout but     getting error while setting the second layout. Waiting for response if any body know resolution for this error.

Thanx and regards,
Dnyanesh                    .
                

[urgent] Disconnected Object Error (run Time)
Im working in vb6 and im getting an error

Error Number : -2147417848
Error Message : "The object invoked has disconnected from its client"


but this problem is just when i execute exe file of my proj but if i execute it from my code it won't give me any error.... plz reply

Please Help: Automation Error Unspecified Error When Trying To Instantiate An Object
Hi,

I'm developing an Excel Macro (VB) that can launch a Data Junction project (Data Junction is a third party deveopment tool... not important to know anything about it for this question). I've included the Data Junction Type Libraries under References --> Tools.

Here is the code that I'm trying to execute (lifted straight out of an example from Data Junction):

Code:
Dim djengine As DJEC.Engine
Set djengine = New DJEC.Engine
djengine.InitializationFile = "C:WINNTdjeng750.ini"


However, I get a runtime error that is caused by the 2nd line of code (Set djengine = New DJEC.Engine):

Run-time error '-2147467259 (80004005)':
Automation error
Unspecified error

Any ideas why this might be happening? Workarounds? I'm new to VBA and COM and am unsure how to solve this problem. Thanks.

Sanjay Pathiyal
sp228@hotmail.com
PS I originally posted this to the general discussion board, but feel it's more appropriate here...

Object Automation Error
I am writing a program using ftp to get a text file, decode the file and store the relative information into SQL database. And the program can be set to poll the data on certain time interval, for e.g once every minute. However, I had been encountering this problem of Object Automation Error, which is not instantaneous error. It occurs sometime (e.g maybe 3-4 hours or 1 day) after the program execution, but the occurance is not consistant at certain time interval. In other word, it is not predictable. The error message box displayed "Excess violation 0xc0000005" and invoked a Dr Watson error.

VB 6.0 Automation Error With NotesDocument Object...
Hello,
i'am working on a major "intermittent problem" for visual basic application using a NotesDocument class to manipulate documents... My major problem is that when i call NotesDocument.save method ... it returns false and does not record the document, then visual basic throws an error (-2147217504) .
This is what the code looks like:

Public Function NotesEnregistreDocument(domDocument As NotesDocument) As Boolean

On Error GoTo NotesEnregistrementDocument_Error:
Dim iCounter As Integer
Dim timeStart As Single

iCounter = 0
NotesEnregistreDocument = False
Tentative1:
call domDocument.Save(True, True)

NotesEnregistreDocument = True
Exit Function


NotesEnregistrementDocument_Error:
If iCounter < 5 Then
' Retry
'i have a trace function here that records
'a logfile with all information
'including the counter, the err.numer etc
timeStart = Timer
Do While Timer < timeStart + 1 'wait 1 sec then retry
DoEvents
Loop
iCounter = iCounter + 1
Resume Tentative1
End If

NotesEnregistreDocument = False

End Function

The error we get is "-2147217504 " ..(wich is the err.number that i trace at the moment we trapp the error).
This problem is intermittent .. because when ever we retart the operation it will work ...
It is really intermittent.As you can see i used a timer ...i thought that maybe the Notes server could be too busy etc..and when we wanted to record the document it just wouldn't do it since there was too much activity(wich is not the case and the notes document base is ok).
So the problem is related to the NotesDocument object.. and i used a variable that would contain the return value of domDocument.Save ... and the variable has allways been false when this problem arrives...
The project uses visual basic 6.0 with service pack 4 installed running on a windows NT 4.00.1381 workstation with service pack 6.0.
If any one of you can help me, dont hesitate! PLz.
Thank you very much!
psst you can send me an e-mail at:
condor28@caramail.com

Error - Method 'Update' Not Supported By Automation Object
Hi i am sending a range of text from excel to outlook successfully the first time through. if i attempt to send again (without closing and reopening the spreadsheet) i get an error at the Send command

Run-time error '-2147418113 (8000fff)': Method 'Update' not supported by automation object

i use redemption - my code is fairly simple

Dim SafeItem
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
With ActiveSheet.MailEnvelope
    SafeItem.Item = .Item
    SafeItem.Recipients.Add ...
    Range("AR50:AT92").Select
    SafeItem.Send
...
Set SafeItem = Nothing

i stuck this in at the end

Set Utils = CreateObject("Redemption.MAPIUtils")
Utils.Cleanup

but it still happens

anyone have any ideas?

thanks.




Edited by - sbcosmo on 1/27/2006 7:36:29 AM

Automation Runtime Error 429 Activex Component Can't Create Object
I am trying to generate an Outlook object. On all the machines only one is having the problem. It is a 98 machine. Here is the code. The error is thrown as soon as I try to instantiate the object on the first line. Also, if I remove the "localhost" parameter, it does not work on a select other machines, but not all of them. Anyone know how I can fix this? Is it a dll problem?


Code:

Public Sub generate_email()
Set objOutlook = CreateObject("Outlook.Application", "localhost")
Set mailRequester = objOutlook.CreateItem(olMailItem)
If strMakeDir <> "" Then
Set oFolderAttachments = oFS.GetFolder(strMakeDir & "").Files
End If

mailRequester.To = strEmailRequester
mailRequester.Subject = "Project Request Number " & strPT_Num & " " & "has been assigned to you."

If strFileUploaded = "y" Or strAdditionalInfo = "y" Then
mailRequester.Body = "Project Request Number: " & strPT_Num & vbCrLf & "Customer: " & strCustomer & vbCrLf & "Submitter: " & strSubmitter & vbCrLf & "Request Date: " & strRequestDate & vbCrLf & "Due Date: " & strDueDate & vbCrLf & "Description: " & strDescription & vbCrLf & "Priority: " & strPriorityTicket & vbCrLf & "Problem Type: " & strPType & vbCrLf & "Files have been uploaded for the project request. Please visit the query page the view and download the files associated with this Project Request"

For Each fileObject In oFolderAttachments
Set oFileAttach = oFS.GetFile(fileObject)
mailRequester.Attachments.Add (oFileAttach)
Next
Else
mailRequester.Body = "Project Request Number: " & strPT_Num & vbCrLf & "Customer: " & strCustomer & vbCrLf & "Submitter: " & strSubmitter & vbCrLf & "Request Date: " & strRequestDate & vbCrLf & "Due Date: " & strDueDate & vbCrLf & "Description: " & strDescription & vbCrLf & "Priority: " & strPriorityTicket & vbCrLf & "Problem Type: " & strPType
End If

mailRequester.Send

End Sub

Access Automation Error:ActiveX Component Can't Create Object
High everyone,
I am writing an application that will run daily. This will read from
a file and depending on the outcome will either update or add to our life
database. The daily file to process will contain about 70,000 records. we
are trying to limit the transaction on the database as much as possible.
What I intended doing is I created an access database. I run an access
query to bring all the records affected to local database and then work of
that. after that then I post only those that needs to be posted back to the
database. I have couple queries and make use of the Access DoCmd. I also
use the CreateObject Function and New Operator. My boss does not want to
install Access on the Computer that will run the app. All what I am trying
to say is, Can I Automate Microsoft Office (Access Automation ) without
having Access installed on the Client machine (Computer) that will run the
application? It works great on my computer (the developing computer). I
have tried to installed this application on a computer that does not have
Access Installed and I am getting Run-Time Error 429 "ActiveX Component
Can't Create Object". Please Help

sampson

Object Has Diconnected From Clients
Hello All,
One of my user all the sudden got this error message "Automation Error - Object has diconnected from Clients". This is the first time I've ever seen it. Any ideas how to fix it. Thank you very much.

Automation Error. Application-defined Or Object-defined Error.
Hello.

I have VB6 application which works with a MS access database to store information.

From this application I then generate and open word documents. This has been working fine on the computers running the application. These computers has mainly been Windows XP SP2 with Office 2003/XP/2000.

Then we had to get a new computer and it came with Vista. And now my program cant get the word documents to open. So I thought that this might be a Vista problem but then I tried it on another Vista machine with the same version of Office - Office 2003 and there it works. So Vista isn't the problem here...but what is the problem?

I use code like:

dim wdApp as Word.Application
dim wdDoc as Word.Document

set wdApp....

and then i try to open the document. On this particular machine i get the following error when trying to open a document:

Automation error. Application-defined or object-defined error.

I can see in taskmanager that word is in fact started by the application but then it fails to continue.


Can someone give me some hints on where to search for a solution on this. 3 hours of googling hasnt got me any closer to a solution.

Regards
Daniel

Passing Disconnected Recordset From VB COM Object To ASP Script..need Help
I am writing an ASP application that retrieves results from multiple databases (3 DB2 and 1 SQL Server) simultaneously. In order to speed up response time I am executing all queries asynchronously using ADO to run the multiple queries in parallel. I then take the results of each query and combine them into a disconnected recordset and return this recordset to the script. This works great when I use my laptop as the server and client, but when I deploy to a test server and hit from a remote computer I get a 424 "Object Required" error at the point in the script where I run the COM Object "Execute" method. Both the ASP script and VB6 COM Object (ActiveX DLL) are deployed under the same virtual directory on an IIS 5 Webserver. I suspect it has something to do with having to use adUseClient cursor location for the disconnected recordsets, but I can't come up with a way around this. Is this really my problem? Anyone have any ideas on how to fix? Thanks a bunch.....

Relevant code from ASP script:

Code:
'Create ADO recordset for storing SQL queries to send to COM object
Dim sqlRS
set sqlRS = Server.CreateObject("ADODB.recordset")
sqlRS.CursorLocation = 3 'adUseClient
sqlRS.CursorType = 3 'adOpenStatic


sqlRS.Fields.Append "SQLString", 200, 500000 '200 = adVarChar

sqlRS.Open
sqlRS.ActiveConnection = Nothing


'Create ADO recordset for storing connection strings to send to COM object (order must match order of sqlRS)
Dim dbconnRS
set dbconnRS = Server.CreateObject("ADODB.recordset")
dbconnRS.CursorLocation = 3 'adUseClient
dbconnRS.CursorType = 3 'adOpenStatic


dbconnRS.Fields.Append "ConnString", 200, 2000 '200 = adVarChar

dbconnRS.Open
dbconnRS.ActiveConnection = Nothing

Dim dResults
Dim dbRetObject

set dbRetObject = Server.CreateObject("RetrieveRETData.Retrieve")

'Call the COM object to execute all the queries against the appropriate DBs and return an ADO recordset with the federated results
set dResults = dbRetObject.Execute(dbconnRS,sqlRS)



VB COM Object Method Code snippet:

VB Code:
Public Function Execute(ByVal DBConnections As ADODB.Recordset, _ByVal SQLStatements As ADODB.Recordset) As ADODB.Recordset  Dim MasterRS As New ADODB.RecordsetDim finished As BooleanDim tempFin As Boolean  'Define the Recordset that will contain the federated results of all queriesMasterRS.CursorLocation = adUseClientMasterRS.CursorType = adOpenStatic MasterRS.Fields.Append "NameTagCall", adVarChar, 16MasterRS.Fields.Append "Location", adVarChar, 254MasterRS.Fields.Append "NameTagFolder", adVarChar, 10MasterRS.Fields.Append "ArchiveDate", adDBTimeStampMasterRS.Fields.Append "ObjId", adChar, 16MasterRS.Fields.Append "FileName", adVarChar, 64MasterRS.OpenMasterRS.ActiveConnection = Nothing  ' Loop through all the Connection Strings and execute queries asynchronously Do While Not DBConnections.EOF   Set conn = New Connection  Dim cmd As New ADODB.Command   cmd.CommandText = SQLStatements("SQLString")  cmd.CommandType = adCmdText  cmd.CommandTimeout = 3600   Set rs = New ADODB.Recordset   conn.Open DBConnections("ConnString")   Set cmd.ActiveConnection = conn   rs.CacheSize = 10000   rs.Open cmd, , , , adAsyncExecute   Set rsArray(count) = rs   DBConnections.MoveNext  SQLStatements.MoveNext  count = count + 1   Set rs = Nothing  Set conn = Nothing  Set cmd = Nothing Loop finished = False  'Test to ensure that all DB queries have finishedWhile Not finished   finished = False  tempFin = True   For i = 0 To UBound(rsArray)    If ((rsArray(i).State <> adStateFetching) And (rsArray(i).State <> adStateExecuting) And tempFin) Then      finished = True    Else      tempFin = False      finished = False    End If  Next Wend  'Upon Query completion(s) build the federated recordset For i = 0 To UBound(rsArray)  rsArray(i).ActiveConnection = Nothing   If Not rsArray(i).EOF Then    rsArray(i).MoveFirst     Do While Not rsArray(i).EOF       MasterRS.AddNew       MasterRS("ObjId") = rsArray(i)("ObjId")      MasterRS("NameTagCall") = rsArray(i)("NameTagCall")      MasterRS("Location") = rsArray(i)("Location")      MasterRS("NameTagFolder") = rsArray(i)("NameTagFolder")      MasterRS("ArchiveDate") = rsArray(i)("ArchiveDate")      MasterRS("FileName") = rsArray(i)("FileName")      MasterRS.Update       rsArray(i).MoveNext    Loop  End IfNext '~~~~~~~~~~~~ Pass the RecordSet ~~~~~~~~~~~~~~~~Set Execute = MasterRS'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End Function

Program Still Running After Unloading Form (maybe Object Not Disconnected)
Hi all,

I'm working in VB6 and
after the form is unloaded, the program still appears in the task manager
window. I have a few questions related to that:

1) I suppose it has to do with some object that is still in memory (didn't
disconnect it with the Set blah = nothing stuff. Am I right?

2) Is there any debugger that shows me which objects are still
alive in the memory?

3) Do I have to set to nothing the pictures in msgrid cells, that were set
through Set msflexgrid1.cellpicture = ImageList1 ...?

4) I have code of this sort
[vb]
Sub A()
Dim ppApp As Object
Set ppApp = CreateObject("Powerpoint.Application")
' Make it visible.
ppApp.Visible = True

' Add a new presentation.
'Early Binding
'Dim ppPres As PowerPoint.Presentation
'Set ppPres = ppApp.Presentations.Add

'Late Binding
Dim ppPres As Object
Set ppPres = ppApp.Presentations.Add

Present ppPres
Set ppPres = Nothing
Set ppApp = Nothing
end sub

Sub Present (pp as Object)

' do some stuff with pp
end sub

[vb]

Do I have to set pp = Nothing in the Present Subroutine before end Sub?
I assumed not because that would set the actual parameter ppPres
woul be set to nothing in the caller subroutine A. Am I right?

Thanks!! Excuse me for this long question, but I don't manage
Objects in VB.

rr.

Error When App Is Run From Clients
I don't get it at all.  I installed my app on a server, and everything is fine when I run it there.  But when I try to run it from the workstations, I see run time error. The error says that this so-and-so controls are not registered.

I find this really strange 'coz all controls are registered on the server after my installation. And I definitely see some controls (like command buttons and text boxes) on the MDI form when I run my app (from the workstations).  But when I try to open those forms with SSTab, Crystal Report Control and MSHFlexGrid, there is an error.

Don't you find it strange?  Why do the command buttons, and text boxes come out OK in the MDI form? Why not the SSTab and MSHFlexGrid? Aren't they controls too like command buttons and text boxes?

My purpose is for the clients to run the application from the server so that I only have to make one installation.

I really am perplexed. I know my app's packaging is perfect coz I tried it to several computers.  Can somebody tell me what to do. I'd really appreciate it.

Winsock Error Multiple Clients
i have a central call tracking app, monitoring calls between users in the company.i need to send the call date associated with the call to the respective users . for this purpose i have a database of Ipaddresses asscoiated with the users , which is automatically refeshed.

ther are abt 80 client machines,and the code in the server side looks like this;

If IPAddress <> "" Then
Winsock1.RemoteHost = Trim(IPAddress)
Winsock1.RemotePort = 1007
Winsock1.Connect
DoEvents

If Winsock1.State = 7 Then
Winsock1.SendData "Internal" & ";" & DestNumber & ";" & StartDateTime & ";" & ChDur & ";" & Trim(DialledPerson) & ";"
DoEvents
End If
Winsock1.Close
End If

If CType = "I" And DialledIP <> "" Then
Winsock1.RemoteHost = Trim(DialledIP)
Winsock1.RemotePort = 1007
Winsock1.Connect
DoEvents
If Winsock1.State = 7 Then
Winsock1.SendData "Incoming" & ";" & AuthCode & ";" & StartDateTime & ";" & ChDur & ";" & Trim(UserName) & ";"
DoEvents
End If

Winsock1.Close
End If


in the client side i have;


Private Sub socket_Close(Index As Integer)
Socket(Index).Close
Unload Socket(Index)
iSockets = iSockets - 1


End Sub

Private Sub socket_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Index = 0 Then

sRequestID = requestID
iSockets = iSockets + 1

Load Socket(iSockets)
Socket(iSockets).LocalPort = 1007
Socket(iSockets).Accept requestID
End If
End Sub

Private Sub form_Load()

Socket(0).LocalPort = 1007
Socket(0).Listen

End Sub

Private Sub Socket_DataArrival(Index As Integer, ByVal bytesTotal As Long)


Socket(Index).GetData sItemData, vbString
'' Process here


End Sub

as you can see i am sending data to 2 client machines per call, but somehow only one of the machines seem to be receiving the data.

on further inspection , i found out that this is because of a socket error

ie...winsock1.state=6 '' SckError

so..the data is never sent.

however the same client seem to be receiving some of the data.

why is this so?

RPC Busy Error On Windows 9x Clients
Dear,

We are working on a 3-tier Business Solution for one of our client using Visual Basic 6.0, MTS 2.0 and SQL Server 7.0 technologies.

Development Environment:
------------------------
DataBase Server:
Win NT Server 4.0
Service Pack 6

Application Server:
Win NT Workstation 4.0
Service Pack 6

Clients:
Windows NT Workstation 4.0 with Service Pack 6
Windows 98 with Service Pack 1.0
Windows 95 with DCOM Version 1.3 for Win95

The application works well on clients running on Windows NT

Workstation.

We have an interesting problem when calling an object in MTS that has a
collection as a parameter of a method from Windows 9x clients.
The followig error occurs:
Error Number: -2147023173
Description : Automation Error. The RPC server is too busy to complete this operation.

Your support on this issue is highly appreciated.

with regards,
Krishna Prasad S

RPC Busy Error On Windows 9x Clients
Dear,

We are working on a 3-tier Business Solution for one of our client using Visual Basic 6.0, MTS 2.0 and SQL Server 7.0 technologies.

Development Environment:
------------------------
DataBase Server:
Win NT Server 4.0
Service Pack 6

Application Server:
Win NT Workstation 4.0
Service Pack 6

Clients:
Windows NT Workstation 4.0 with Service Pack 6
Windows 98 with Service Pack 1.0
Windows 95 with DCOM Version 1.3 for Win95

The application works well on clients running on Windows NT

Workstation.

We have an interesting problem when calling an object in MTS that has a
collection as a parameter of a method from Windows 9x clients.
The followig error occurs:
Error Number: -2147023173
Description : Automation Error. The RPC server is too busy to complete

this operation.

Your kind support on this issue is highly appreciated.

with regards,
Krishna Prasad S
KPIT Infosystems Ltd.,
krishnaprasads@kpit.com

OLE Embedded Object/Object Packager Automation
I would like to mimic the action of double-clicking on an OLE Embedded object and opening it in the designated window. Thus when a slide show contains a slide with the object I would like to programmatically open the contents of the container. What I would like is advice as to how this can be done. With a Presentation with one slide and one OLE Embedded object, I have tried the following:

On a button event I call the following lines:

Code:
ActivePresentation.Slides(1).Shapes(1).Select
ActivePresentation.Slides(1).Shapes(1).OLEFormat.D oVerb 1


But I receive the error message:

Shape (unknown member): Invalid request. The window must be in slide or notes view.

I have also tried surrounding the above code with:

Code:
lOriginalView = ActiveWindow.ViewType
ActiveWindow.ViewType = ppViewSlide
' Do stuff.
ActiveWindow.ViewType = lOriginalView


But I receive the error:

Application (unknown member): Invalid request. There is no currently
active document window.

I have also looked into using SendKeys, ShellExecute and ActivateShape, as well as a third party control that exposes a slide’s events.


 

Unspecified Error When Using Disconnected
I have a disconnected recordset that I use as a data store so that I can use the filter and sort properties. It worked great in VB6 MDAC2.5 on Win98.

We are now porting to Win2K, VB6, MDAC2.6 and I get an unspecified error on the recordset when I try to do an addnew, some other method or even just setting one of the fields. It works great for a while but as the recordset grows, eventually I get 'Unspecified Error' failure. The error does not consistantly happen at the same place everytime, and appears to occur as the recordset grows. This makes me suspect some kind of memory leak or something. Any Ideas? The following is how I create the recordset.

Private Sub createRS as recordset()
Dim rs As New Recordset

'create the recordset
With rs
.Fields.Append "A", adChar, 4
.Fields.Append "B", adChar, 1200
.Fields.Append "C", adChar, 2000
.Fields.Append "C", adChar, 12
.Fields.Append "E", adChar, 50
.Fields.Append "F", adChar, 4
.Fields.Append "G", adChar, 8
.Fields.Append "H", adChar, 8, adFldIsNullable
.Fields.Append "I", adChar, 8
.Fields.Append "J", adInteger
.Fields.Append "K", adInteger
.Fields.Append "L", adChar, 10
.Fields.Append "M", adChar, 40
.Fields.Append "N", adChar, 24
.Fields.Append "O", adChar, 4
.Fields.Append "P", adChar, 4
.Fields.Append "Q", adChar, 4
.Fields.Append "R", adInteger
.Fields.Append "S", adInteger
.Fields.Append "T", adBoolean
.Fields.Append "U", adBoolean
.Fields.Append "V", adBoolean
.Fields.Append "W", adChar, 10, adFldIsNullable
.Fields.Append "X", adChar, 10, adFldIsNullable
.Fields.Append "Y", adInteger
.Fields.Append "X", adBoolean
.Fields.Append "Z", adBoolean
.CursorLocation = adUseClient
.Open
End With
Set createRS = rs

Thanks for any insight.

PSH

Compile Vb6 Application In Xp Kernel Error In W98 Clients
Hi Everybody,
    I developed an application Visual Basic 6.0 and compile it in a XP machine, when this aplication runs in a clients windows 98 SE produces an kernel error when wants to open a Word object. Anyone knows how could I resolve this problem ? Thanks a lot. Ruben

Error With ADO Disconnected Recordset On UpdateBatch
Hello,

I am getting the following error on the statement rst.UpdateBatch
"insufficient base table information for updating or refreshing"
see attachment. I am not sure why so here is the senerio see if you can see my mistake.

Code: 'Step1 get data from Table
Private Sub LoadRst()
    'Instance Object Variables
    Set goConn = New ADODB.Connection
    
    ' Open connection
    goConn.Provider = "ASAProv.70"
    goConn.ConnectionString = "DBF=C:RichardDataTest8.db;;INTEGRATED=NO;User ID=lds;Password=lds;"
    goConn.Open

    ' Prepare Stored Proc execution
    SQL = "{Call DBA.sp_Adm_UserFeatures( '" & UserID & "')} "
    rstTemp.CursorLocation = adUseClient 'rs.CursorLocation = adUseServer
    rstTemp.Open SQL, goConn, adOpenStatic, adLockBatchOptimistic
    ' I have tried adOpenDynamic and adOpenForwardOnly and adOpenKeyset
    Set rstTemp.ActiveConnection = Nothing
    
    goConn.Close
    Set goConn = Nothing

End Sub


Code: 'Step2 Update the disconnected recordset
Private Sub UpdateRst(ByVal lngKey As Long, ByVal Row As Long)
    With rstTemp
        .Find "User_Link_Code = " & lngKey
        If Not .EOF Then
            .Fields("Security_Mask").Value = GetMask(Row)
            .Update
        Else
            'Error routine
        End If
    End With

End Sub


Code: 'Step3 Apply update to table
Public Sub Apply()
    Set goConn = New ADODB.Connection
    goConn.Provider = "ASAProv.70"
    goConn.ConnectionString = "DBF=C:RichardDataTest8.db;;INTEGRATED=NO;User ID=lds;Password=lds;"
    goConn.Open
    
    
' Set rstTemp.ActiveConnection = goConn ' I have tried both way same error
    rstTemp.ActiveConnection = goConn
    rstTemp.UpdateBatch '<<<<<<this is where the error is occuring
    
    rstTemp.Close
    goConn.Close
    Set goConn = Nothing

End Sub

Disconnected Recordset - Binding Error
Hi,

I got an example from this forum on disconnected recordset. However, when I run it on a Win2000 (only OS is installed), I got this error - "can't initialize data bindings". But after I installed Office2000, it worked perfectly. It worked fine even I uninstalled Office2000.

Does anyone know what Office2000 installs to fix this binding error? I downloaded MDAC2.6 SP2 from microsoft.com/data. it still doesn't work.

Any idea?

here is the sample code

private Sub Form_Load()
Dim r as ADOR.Recordset
Dim lCount as Long
'
' Create a new disconnected recordset object
'
set r = new ADOR.Recordset
'
' Setup the fields - you can use any valid type of
' ado field type for these. I've used VarChar just
' for testing / demonstration purposes.
'
r.Fields.Append "Name", adVarChar, 10
r.Fields.Append "Notes", adVarChar, 50
r.CursorType = adOpenDynamic
r.Open
r.AddNew

r.Fields(0).Value = "Chris"
r.Fields(1).Value = "almost over the hill"
'
' Populate the datagrid
'
set DataGrid1.DataSource = r
End Sub


Thanks in adanvce,
k

(solved) Runtime Error In Disconnected Recordset
Hello! Im new to disconnected recordsets and i decided to use it in one of our projects. Im using the listview control (VB6) to display the contents of the MySQL database. The problem is when im adding a new record using AddNew and using the ADO resync method to to update the recordset, a runtime error occurs "Run-time error '-2147217885 (80040e23)'
Key value for this row was changed or deleted at the data store. The local row is now deleted.". The added record is still stored in the database even after the runtime error. As a result, the new record is not displayed in the listview since it's already deleted. pls help...

 

Edited by - kritik on 8/18/2005 6:09:32 PM

Strange Error: Disconnected RS/Datagrid On Addnew
Has anybody experienced this or am I loosing my mind?

Using ADO & Access
I want to show data from MyTable on a datagrid, then let the user add/remove records without saving any changes on MyTable until user´s confirmation/validation... so, I disconnect the RS to play around with the information.

I have some textboxes and a command button in order to add info to the datagrid using RS.Addnew. To delete rows, the user should delete them using the DEL key on the datagrid.

So adding and deleting rows works fine EXEPT when there are some records in the datagrid, and the all of them are deleted. The RS.recordcount = 0, but after a RS.Addnew it remains in CERO!!! No matter how many .Addnews there are, the .recordcount remains in CERO!

I already tried unbinding the datagrid from the RS and then binding it again after the .update but doesn´t make difference. I put a datagrid.refresh on the afterdelete event, and nothing either!


Is this a Bug? Or am I missing something?

I appreciate any help.

Error Reporting - How To Send The Email Report From The Clients Computer
My application has an error reporting form that works fine from my computer, but does not work from a clients computer...how can I set it up so that the email report is sent to me using the client's internet connection?

Thanks

_________________________________________________________________

- Sending Data To Multiple Clients Via Winsock- Same 40006 Error.
trying to send data to multiple clients, but keep getting same error - 40006: Wrong protocol or connection state for the requested transaction or request.

The first send works fine- always throws error on 2nd recipient. Nothing wrong in sending just one request to that client.

2 Winsocks, not indexed - vb6
Code:

Code:
                        'SEND TO FIRST
                        With frmWinsocks.Winsock5
                            .Connect 192.1.1.111, 1007
                            .SendData "data"
                            DoEvents
                            Call frmWinsocks.SafeCloseAfter 'CLOSES CONNECTION
                            DoEvents
                        End With
                
                        'SEND TO 2ND
                        With frmWinsocks.Winsock6
                            .Connect 192.2.2.222, 1008
                            DoEvents
                            .SendData "data 2" '<-ERROR HERE - error #40006 - the state is 6 (connecting), but shouldn't be
                            DoEvents
                            Call frmWinsocks.SafeCloseAfter6 CLOSES CONNECTION
                            DoEvents
                        End With





ARE THERE ANY ADVANCED WINSOCK CONTROLS OUT THERE? SOMETHING WITH ERROR CHECKING AND MULTIUSER SERVER/CLIENTS?



Edited by - pbeast on 2/3/2007 2:58:25 AM

Service && WithEvents SHDocVw Automation - "automation Error" -2147220990 (80040202)
Hi.
I have a VB app that i run from a service (The app run at winsta0\default).
The app runs under the localsystem account.

In my app i have:
Private WithEvents winShell As SHDocVw.ShellWindows

and then in one of the functions:
set winShell = new SHDocVw.ShellWindows
When it came to that set line, i get this error in a popup dialog:
"automation error" -2147220990 (80040202)

Some points:
1)When i run the app not from the service, everything is working fine
2)When i remove the WithEvents, i do not get that error (but as you can understand it worthless without the Events).
3)When the app is not running under localsystem then everything is ok.

The problem is related to the combination of the app that runs under the system account, automation and the WithEvents keyword.

I tried to make the service interactive by going to the service manager, right click properties, and checking that box - it did not solve it.

Any suggestions?
(the app must stay running from the systemaccount - i can not change it)
I run it on XP pro.

Thanks

Service && WithEvents SHDocVw Automation - "automation Error" -2147220990 (80040202)
Hi.
I have a VB app that i run from a service (The app run at winsta0\default).
The app runs under the localsystem account.

In my app i have:
Private WithEvents winShell As SHDocVw.ShellWindows

and then in one of the functions:
set winShell = new SHDocVw.ShellWindows
When it came to that set line, i get this error in a popup dialog:
"automation error" -2147220990 (80040202)

Some points:
1)When i run the app not from the service, everything is working fine
2)When i remove the WithEvents, i do not get that error (but as you can understand it worthless without the Events).
3)When the app is not running under localsystem then everything is ok.

The problem is related to the combination of the app that runs under the system account, automation and the WithEvents keyword.

I tried to make the service interactive by going to the service manager, right click properties, and checking that box - it did not solve it.

Any suggestions?
(the app must stay running from the systemaccount - i can not change it)
I run it on XP pro.

Thanks

Creating Disconnected Recordset With A Command Object Populated Recordset
    Hello!! I'm doing a function for executing stored procedures to avoid
repititive task everytime I need to execute a stored proc. I have no problem
for the function for UPDATE, INSERT & DELETE. My problem is with the stored
procedures that use SELECT statement or returns a recordset. I always
make a disconnected recordset to save resources on the server. If I use the
Open methon (rstRS.Open), I can create a disconnected recordset but when I try
to populate the record by "Set rstRS = cmd.Execute", then an error occurs.
It seems that it cannot set the recordset's active connection property to nothing
when it was populated by a command object. Are there any get around on this?

Here is my code:
-------------------------------------------------------------------------------
Code:
'this function returns a disconnected RS
Public Function GetRS(SPName As String, DBConn, ParamArray aParams()) As ADODB.Recordset
  Dim conDB As ADODB.Connection
  Dim rstRS As New ADODB.Recordset
  Dim cmd As New ADODB.Command

  ShowStat "Setting cursor . . ."
  'Create the Recordset object
  rstRS.CursorLocation = adUseClient
  
  ShowStat "Opening DBase connection . . ."
  'Open a connection
  If DBConn = "" Then
    Set conDB = New ADODB.Connection
    conDB.Open strConn
    cmd.ActiveConnection = conDB
  Else
    cmd.ActiveConnection = DBConn
  End If
  
  cmd.CommandText = SPName
  cmd.CommandType = adCmdStoredProc
  
  ShowStat "Retrieving data . . ."
  
  'Populate recordset
  If UBound(aParams()) >= 0 Then
    Set rstRS = cmd.Execute(, aParams())
  Else
    Set rstRS = cmd.Execute
  End If

  '***********************************************
  'if i used this one in populating the recordset
  'everything is fine, but the problem is that you
  'can't set the parameters needed by stored proc
  '***********************************************
  ' rstRS.Open cmd
  
  'Disconnect the Recordset Connection
   Set rstRS.ActiveConnection = Nothing <<<<<error goes here
                                                "cannot ....when the object is open"

  'Return the Recordset
  Set GetRS = rstRS

  'Clean up...
  If DBConn = "" Then
    conDB.Close
    Set conDB = Nothing
  End If
  Set cmd = Nothing
  CloseStat
  Exit Function

End Function

--------------------------------------------------------------------------------

Thanks in advance,

enzo c",)

Error Msg - "Run-Time Error &#039;-2147417848(80010108)&#039;: Automation Error
I have a menu-item which when clicked starts up a browser and goes to the site which the user selected from the appropriate menulist. It works fine in VB6 when I click on the play button, (design time). However, after using the Package & Deployment Wizard, I get the following error message: "Run-Time error '-2147417848(80010108)': Automation Error What in the world is going on. Is it that the browser object is not installing correctly since it works in the VB6 environment? :-( Or is it some code that is creating the problem. I am still new at this, but making great progress. Just ready to get this beta out to some of my testers.

I was under the impression that if you could run the program during the design process without any problems, then you could run it after compiling and packaging with the Deployment Wizard.

email should be on my post,... however it is:
scrocker@midsouth.rr.com

Thanks,
Sal

Copyright © 2005-08 www.BigResource.com, All rights reserved