Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

errors on client computers 2

Status
Not open for further replies.

Merkaba

Programmer
Jun 14, 2005
69
US
I'm new to vb.net and I've made an app for a client and it works on my pc, but not on his or anyone else without vs.net installed on it. The .Net Framework is installed on the client, including sp1. This is an XP Home OS Machine. Do I need to run a command on the client pc to get this to work, like dotnetfx.exe? I fixed my IIS with the aspnet_regiis -i so I'm figuring this is just another one of Microsoft's early glitches with the whole .Net thing.
Sorry, I don't have the exact error message I'm getting, but the app works with pc's where vs.net is installed.

Thanks in Advance!!!



Bob

 
While doing some deeper research on this site i found other people having the same problem... the error is like this one:

Commom language debugging services
application has generated an exception
process id=0x358 thread id =0x2fc

oddly, it seems the app works on pc's with VS.Net installed on them, but no others. I tried 3 random computers, all up-to-date with the .Net Framework 1.0 and 1.1, but still get the error if VS isn't installed... I'm gonna try some stuff and see what I can come up with. If anyone has a solution, please be so kind as to shed me some light [sunshine] Thanks...

Bob
 
Have you compiled the application with a 'debug' configuration by any chance rather than a 'release' configuration?

Rhys

"Vampireware /n/,a project, capable of sucking the lifeblood out of anyone unfortunate enough to be assigned to it, which never actually sees the light of day, but nonetheless refuses to die."

"I see dead pixels!
 
I used the Build Solution option in the main menu of VS.Net 2003... Not sure but I'll try setting it to Release and try it on the client pc. Thanks...


Bob
 
Make sure that your development machine is patched. I've run into similar issues when the deployed version of the framework does not match the version used for developing. Since you're working in VS.Net 2k3 you only need to worry about the v1.1 frame work. Make sure (ie: Uninstall-Reinstall) that your dev machine has the same version as the client machines.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Do I have to Register the .dll files or run an Installer to get it to work? I have the .Net Framework 1.1 with the patches on the client pc's. I tried using:

regsvr32 Interop.ADOX.dll /i

regsvr32 Interop.ADOR.dll /i

but it wouldn't go thru, it said something about it could register but couldn't place or initialize it or something??? Again, it DOES work on machines with any version of VS.Net installed on them, 2k2 or 2k3. Thanks.


Bob
 
as far as I know adox and adodb are not part of the framewrok and should be copied with the app.Create an install project and that should take care of that and it should work then.

And no you don't need to register them.

Am I correct that you are still using ADODB??

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Thanks, yes I am using ADOX and ADODB to query tables and their contents from an Access 2000 DB. I originally wrote this app in vb6 so I was using ADODB alone. I'm still new to the whole VB.Net so I don't know the best way to do things, btw the client is my Dad and it's a simple rolodex program, but I'm teaching myself this for work. I mainly design web applications, but we're slow at the moment so I decided to try .Net out. Is there a better way than using an ADODB Connection?? I was using OleDB for a while to made a DataGrid so I could print the Contacts from the Rolodex, but there were too many columns for the page, so I just made a dynamic text file from the DB Query and converted it to a string line by line and fed it to the printer. I'm just familiar with ADODB so I stuck with it. Should I use OleDB?? Also, can you give me a link to a helpful article on making the Install Project?? Thanks so much!!

Bob
 
depends are you using access as the back end?

I geuss so. Then by all means switch to oledb show us the adodb code or parts of it and rick ;-) will translate it to oledb. If you use oledb you won't have to create an install project.

how to create an install project. type this "vb.net" install project in google and you will get plenty of answers.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Thanks for the timely help!

Can I still use ADOX without an installer?

Here is an example of my code... I apologize in advance if it sucks [ponder]

Code:
    Public Sub ContactPopulate()

        Contacts.Nodes.Clear()


        Dim TableList As ADOX.Catalog = New Catalog
        Dim Table As ADOX.Table


        Dim Counter As Long 'long counter for looping 
        Dim adoTables() As String 'create an array to hold the names of tables 

        TableList.ActiveConnection = Conn

        ReDim adoTables(0) 'size the array to hold one element 
        Counter = 0 'reset the counter to zero 

        For Each Table In TableList.Tables 'instantiate the adoTable variable and begin looping through the tables 
            If Table.Type = "TABLE" Then
                    adoTables(Counter) = Table.Name.ToString 'get the current table name 
                    ReDim Preserve adoTables(UBound(adoTables) + 1) 'resize the array one element larger 
                    Counter = Counter + 1 'advance your counter
                End If
            End If

        Next 'advance to the next table in the catalog

        ReDim Preserve adoTables(UBound(adoTables) - 1) 'finally resize the array one element smaller to get rid of the empty element in the last position 
        Dim myRootNode As TreeNode = New TreeNode("Contacts")

        GroupBox.Text = "Select a Contact Group"
        GroupBox.Items.Clear()
        GroupBox.Items.AddRange(adoTables)

        For Counter = LBound(adoTables) To UBound(adoTables)

            Dim myTable As String = adoTables(Counter)
            Dim QueryStr As String = "select Name from [" & myTable & "] order by Name"
            Dim ContactArray As New ArrayList
            ContactRS.Open(QueryStr, Conn, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)

            With ContactRS

                Dim iRecord As Long = 0
                If Not .EOF Then
                    Do Until .EOF

                        ContactArray.Add(New TreeNode(.Fields("Name").Value))
                        .MoveNext()

                    Loop

                End If

                .Close()

            End With

            Dim Count As Integer = ContactArray.Count
            ContactArray.TrimToSize()
            Dim myContacts() As TreeNode = New TreeNode(Count - 1) {}
            ContactArray.CopyTo(myContacts)
            Dim myTableNode As TreeNode = New TreeNode(myTable, myContacts)
            myRootNode.Nodes.Add(myTableNode)


        Next

        Contacts.Nodes.Add(myRootNode)


        TableList = Nothing     'destroy the catalog object 

        Contacts.ExpandAll()

    End Sub

sorry it's so long, but it gives a good idea on what most of my queries are like. The rest are just using ADODB.Recordset objects with SQL SELECT statements. I also like the Updateable Recordset
(i.e. .fields().Value = <value>
.Update
)
so if thats possible in OleDB, could you show me. Thanks alot!!! I hope this works [2thumbsup]


Bob
 
sorry you forgot to mention that it was access but I'm pretty sure it is. And think you are trying to put all the tables in a groupbox and then make some kind of treeview.

try this just add a treeview, a button and a listbox to your form and then add this to the button click event and see what it does.

Code:
Dim contemp As New OleDbConnection
        Dim comtemp As New OleDbCommand
        Dim adptemp As New OleDbDataAdapter
        Dim dtTablenames As New DataTable
        Dim dtselect As New DataTable
        contacts.Nodes.Clear()

        Dim myRootNode As TreeNode = New TreeNode("Contacts")

        If OpenFileDialog1.ShowDialog = DialogResult.OK Then
            contemp.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & OpenFileDialog1.FileName & ";User Id=admin;Password=;"
            Try
                contemp.Open()
            Catch ex As Exception
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Exit Sub
            End Try
            Try
                dtTablenames = contemp.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, Nothing})
            Catch ex As Exception
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                Exit Sub
            End Try
            ListBox1.Text = "Select a Contact Group"
            ListBox1.DataSource = dtTablenames
            ListBox1.DisplayMember = dtTablenames.Columns(2).ColumnName
            ListBox1.ValueMember = dtTablenames.Columns(2).ColumnName
            comtemp.Connection = contemp
            adptemp.SelectCommand = comtemp
            For Counter As Integer = 0 To dtTablenames.Rows.Count - 1
                If dtTablenames.Rows(Counter).Item(2).ToString.ToLower.StartsWith("msys") = False Then
                    Dim ContactArray As New ArrayList
                    dtselect = New DataTable
                    comtemp.CommandText = "select Name from [" & dtTablenames.Rows(Counter).Item(2) & "] order by Name"
                    Try
                        adptemp.Fill(dtselect)
                    Catch ex As Exception
                        MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
                        'Exit Sub
                    End Try
                    For inttemp2 As Integer = 0 To dtselect.Rows.Count - 1
                        ContactArray.Add(New TreeNode(dtselect.Rows(inttemp2).Item(0)))
                    Next
                    Dim Count As Integer = ContactArray.Count
                    ContactArray.TrimToSize()
                    Dim myContacts() As TreeNode = New TreeNode(Count - 1) {}
                    ContactArray.CopyTo(myContacts)
                    Dim myTableNode As TreeNode = New TreeNode(dtTablenames.Rows(Counter).Item(2), myContacts)
                    myRootNode.Nodes.Add(myTableNode)
                End If
            Next

            contacts.Nodes.Add(myRootNode)

            contacts.ExpandAll()
        End If

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
thanks!!! you've been most helpful. I have to redo the whole project for the most part, so I'll get back to you and let you know what happened... A few questions tho:

- should I remove the references to ADOX and ADODB?
- What reference do i add for OleDB?
- can I alphabetically sort the treeview nodes?

thats all i got for now...

Thanks Again!!! [medal]


Bob
 
1. yes
2. none, it's part of the system.data.dll (I think)
3. I actually don't know but you could sort the arraylist


Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Ok, I got the TreeView working, but the ComboBox has the System Tables in it. I moved inside the

if ... "msys" = FALSE

and unbound it and just added the table names, which also fixed calling the table name from the ComboBox to update that table from generating errors. I DID bind the textboxes with the various fields in them that display the Contacts for this Rolodex (yeah, I'm making a crappy rolodex) and that works good. I just have to try it on a pc without VS.Net installed on it now... cross ur fingers!!!

btw... it seems to sort just fine by itself the way it is with the "order by Name" in the SQLString.

Thanks

Bob



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top