VB.Net App Runs On Most Client Networks But Will Not Run On One Network

Posted on 2006-04-07
Last Modified: 2010-04-23
I have a very simple VB.Net app that does a query on a remote SQL Server 2005
database and displays query results in a grid and prints a Crystal report.  I
have installed it on several different clients on various networks, but it
wil not execute on one of my client's networks - the one where the SQL Server
and the subject database is located and which is running Windows 2003 Server.

In the failing app, I have a logon function that displays a login form,
accepts user ID and password, validates them against an SQL Server table,
displays login errors and then displays a menu form if the login is valid.  
The login form is displayed and accepted, the SQL Server lookup works
correctly, the error messages boxes display correctly, but the menu form
display code spawns a CLR "exception has occurred that cannot be handled"
dialog box.

I access the SQL Server database using a UDL file.

The same app installed on most networks/workstations works correctly.

However, it will not run on any workstation in the same domain as the SQL Server that manages the database (the one pointed to by the UDL) is located.  All of the failing workstations are running Windows XP Pro and VB.Net Framework 1.1 with
a service pack.

The setup/installation for this app was generated by Visual Studio .Net 2003.

Any clues?
Question by:portdata
    LVL 6

    Expert Comment

    Is it SQL 2000 instead of SQL 2005 running?  One issue that I've come across is the naming convention.  The database name for a SQL 2000 database needs to be all one word instead of being broken up.  For example "My Database" Wrong, "MyDatabase" Correct.

    Another could be the security settings for the network.  I don't know how locked down they are, but I've seen issues with security before especially in a 2003 environment.

    Try this, install the program locally on the server with the database and see the type of error messages you might get.  Are you placing Try statements in your code to catch messages?  Example:

    'Your code here along with any SQL Scripts

            Catch Exp As SQLException
                MsgBox(Exp.Message, MsgBoxStyle.Critical, "SQL Error")

            Catch Exp As Exception
                MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error")
            End Try

    I'm just spouting off some general ideas, hopefully they help.

    Author Comment

    No, it is SQL Server 2005.

    They have other Visual Studio .Net apps running on their workstations accessing the same database.

    Our program was written to supplement a system they already have which cannot do queries the way they want them to be run - by multiple selection criteria (like customer name, product ID and date received" in a single query.  So, we are trying to run our query ontheir existing workstations to give them the additional capability.

    I am running that same query from my PC at my office (I am on my own SBS 2003 domain 60 miles away from them), connected to their SQL Server remotely using a UDL over a VPN link, and it works just fine.

    I install the same app on one of their domain-connected PC's and it refuses to run.

    SQL Server is not the problem.  The first thing my app does is give them a login screen to enter user ID and password (which are validated against the same SQL Server database and it works just fine.  If the user ID or password are invalid, I see the msg box that I am displaying to show them the error.  If they are valid, andI try to display the query menu, then I get a common language runtime dialog box with an error tellingme to use the JIT debugger (which is not installed on those PC's.)

    We are attempting to run the compiled runtime code on the server with the database - that is the only place that the error occurs.  On any other network connected remotely to them, it works just fine.

    They do not have VB.Net or Visual Studio.Net installed.  We are developing at our own offices.

    Just FYI, I am a Microsoft Certified Partner and an MCP/Small Business Specialist.  I have been a software developer for 35 years and I write VB.Net code every day of the week.

    This is just plain bizarre!

    LVL 6

    Expert Comment

    Cool.   I don't know what to tell you; you really do have a winner here for the record books.  Especially since you can run the login query with no problem, but the complex query comes back and sticks it's tongue at you.  My thinking is some wacky security settings or at least the environment is somehow affecting this.  I don't think this is a coding issue, but probably an environment issue.  As a certified Partner with Microsoft, try to use the Partner Source to contact someone from the "mother ship" and pose the question to them.   I'm sorry I couldn't be more help.
    LVL 6

    Expert Comment

    I don't know if this is something you want to do, but when I know there is a problem and I think it's an environment issue, I sometimes make a "test compiled program" and place messageboxes between steps of functions, so I can narrow it down where the problem is and what value is causing the issue.   It might help you in figuring out where and what part of the program is being effected by the domain.

    Author Comment

    I did that.

    The error is being raised on a ShowDialog command - just trying to display a menu form.  Nothing unusual - just a bunch of labels.
    LVL 6

    Expert Comment

    by:carmodyk really really do have a winner here. I'm betting this is causing some hair being pulled out.  I know the felling.  ;) Another thought that might help narrow the issue; give any values that are being passed a default value.  For example if you are setting the label.text value to equal something, give it a "this is a default" string value first before passing the variable value, or setup an if then statement where if the object value is nothing or is Null, etc it will equal the default value instead.  There might be one rouge label out there that might be the wrench in the system; how I don't know.  

    Author Comment

    Keep one thing in mind.

    This app works on lots of other computers - only fails on workstations attached to this server, in this domain.

    I even tried stripping out individual labels on the menu and sending a much simpler menu form - still got the error.

    I am now considering reinstalling .Net Framework on one of those PC's to se if that helps in any way.

    All this work for three or four days of consulting billing.
    LVL 6

    Expert Comment

    "This app works on lots of other computers - only fails on workstations attached to this server, in this domain." - Yeah, that's the kicker isn't it?  No problems anywhere else but within the domian.  

    Dude, bummer. Worse part is, it's their environment (domain) that's probably causing the issue.  Since it is SQL 2005 (being sort of new and all), and it fails only within the domain, but not outside, it may require a different type of connection string for inside the domain... but you did say the login query works, so that may not be it.  Just for laughs and giggles check out for maybe a different connection string to use.  Are the users logging in via Windows Authentication mode to the SQL server or are you using a Users table within the database to authenticate them to use the program? If you are using a Users table, then I'm back to scratching my head again.  

    Author Comment

    I am requesting that this question be closed.

    I appreciate carmdoyk's efforts.

    I recoded the app in VB 6 and it worked.

    The original problem is still a mystery and is destined to remain so, at least for now.

    Author Comment

    carmodyk, FYI, the user security was set up properly and users log in with a userID and password, there was no explicit connection string because we use UDL's as the original question stated.  The user ID and password are supplied in the UDL.  The UDL connects to the database correctly- Test Connection works fine.  The app has no problem with the SQL database - it validates the user against the database properly.  The problem here is not likely to be SQL Server access, it is more likely a problem in the VB.Net app and the common language runtime.

    GranMod, as for the points, I do not really care.  I have unlimited points.  I just do not believe that anyone earned them.
    LVL 6

    Expert Comment

    Sorry to hear the program was re-coded in 6.0.  You truly have an oddity on your hands, which is a shame with all that work having to be redone.  I feel your pain.  

    Accepted Solution

    Closed, 500 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Title # Comments Views Activity
    Convert money to nchar 4 34
    Delete files older than dayofyear 2 24
    sql server/ 15 26
    Response back from stored procedure 6 32
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now