Results 1 to 6 of 6

Thread: Odbc connection issue

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Odbc connection issue

    Every once in a while one of my programs will stop responding while trying to read data from a database. If I hover the cursor over the connection variable & expand the properties, it says "Property evaluation failed" for all properties. Can anyone tell me what this means or what might cause this to happen? Thanks...
    Attached Images Attached Images  

  2. #2
    Lively Member
    Join Date
    Mar 2010
    Location
    Ireland
    Posts
    85

    Re: Odbc connection issue

    Post the code your using to connect that database?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Odbc connection issue

    The code is pretty standard & works %99.9 of the time so I don't think that that is the problem.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Odbc connection issue

    is it possible that the connection timed out?

    it would help if you post your code

  5. #5
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Re: Odbc connection issue

    It seems that the message you are getting has to do with the CLR and possibly having an overextended parameter somewhere along the way. Check the size of the data that you passing not only into the sub/function, but also the length of your command string (not connection string). It is not fixable within 2008 that I have seen, although it has been reported......repeatedly!

    My suggestion it go back to something simpler like "Select Top 10 * From [TableName]" and see if you can reproduce it. Also, if you are passing a large string (like 25000 characters), try using like a stringbuilder object instead OR build your string in your sub/function.

    Hope that helps a little!!

    D
    Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP

    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

    Reserved Words in Access | Connection Strings

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Odbc connection issue

    Here's the code, but I really don't think the problem is here:


    Code:
    Using con As New Odbc.OdbcConnection(MyConnectionString)
                Using cmd As New Odbc.OdbcCommand("", con)
    
                    cmd.CommandText = queryString
                    con.Open()
    
                    Try
                        Using myData As Odbc.OdbcDataReader = cmd.ExecuteReader()
    
                            While myData.Read
                            'do something here with the data
                            End While
    
                        End Using
    
                    Catch ex As Exception
                        
                    End Try
    
                End Using
            End Using

    The query itself is fairly simple ... "Select * from [table] where [something] = [something]". Generally it should return less than 100 results.
    Last edited by nbrege; Mar 8th, 2010 at 03:58 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width