Results 1 to 4 of 4

Thread: Collating Sequence Error???

  1. #1

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    49

    Collating Sequence Error???

    I'm populating a dataset with records from an access table in code, when i use the where clause in the sql statement it gives me the following error

    "Selected Collating Sequence does not support operating system"

    but runs well without the where clause in the sql statement.

    Can someone please tell me what might be going wrong or any other thing i need to do?

    John

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,449

    Re: Collating Sequence Error???

    Maybe you should post the SQL code.

  3. #3

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    49

    Re: Collating Sequence Error???

    The code is as follows

    VB Code:
    1. myconnLimitedMobility.ConnectionString = strDbLimitedMobility
    2.                 myconnLimitedMobility.Open()
    3.  
    4.                 dtLimMob = New DataTable
    5.                 comLimMob = New Odbc.OdbcCommand("SELECT callin.* FROM callin WHERE para='" & 0 & "'", myconnLimitedMobility)
    6.                 adtLimMob = New Odbc.OdbcDataAdapter(comLimMob)
    7.                 comLimMob.CommandType = CommandType.Text
    8.                 adtLimMob.Fill(dtLimMob)

    Error occurs on the last line, help is needed

    John

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,449

    Re: Collating Sequence Error???

    Does the 'para' column contain numbers or text? You have enclosed the value in single quotes which you only do for text values. If it's a number then don't use quotes. Also, why are you concatenating the values like that? Is it because you intend to be able to enter different values? If not then just put it in the string as a literal:
    VB Code:
    1. comLimMob = New Odbc.OdbcCommand("SELECT callin.* FROM callin WHERE para= 0", myconnLimitedMobility)
    If you do then I strongly suggest using parameters. String concatenation is a dodgy way to build SQL statements for a number of reasons. I've never used OdbcClient and I don't know whether you're using 2003 or 2005 (*sigh*) but it should look something like this:
    VB Code:
    1. comLimMob = New Odbc.OdbcCommand("SELECT callin.* FROM callin WHERE para= @para", myconnLimitedMobility)
    2.  
    3. comLimMob.Parameters.Add("@para", 0)

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