开发者

SQL Error in SQLAnywhere with Ultralite Database on Windows CE 5.0 - VB.net

We are deploying a SQLAnywhere solution on Windows CE 5.0 devices and are running into an error in our first SQL statement.

Definitions are...

Dim dbf As String = "dbf=\Program Files\sfpwarehousescanner\BRAINY2_remote.udb"
Public conn As ULConnection = New iAnywhere.Data.UltraLite.ULConnection(dbf)
Public cmdDel As ULC开发者_如何学Command
Public cmdSel As ULCommand
Public cmdUpd As ULCommand

The offending code...

Public Sub GetDefaults()
  Dim SQL As String = ""
  Try
    SQL = "SELECT ISNULL(Dot, 'T'), ISNULL(Distance, 'L'), ISNULL(Force_Change, 'Y') " _
    & "FROM cims.scan_settings " _
    & "WHERE username = '" + UName.ToString + "'"

    cmdSel = conn.CreateCommand()
    cmdSel.CommandText = SQL

    Dim ULReader As ULDataReader

    ULReader = cmdSel.ExecuteReader

The error we are receiving is...

Error (level = 7) in General.GetDefaults: 
IDS_AMP_INVALID_OPER_ON_EXECUTE_CMD - 
SELECT ISNULL(Dot, 'T'), ISNULL(Distance, 'L'), ISNULL(Force_Change, 'Y') 
FROM cims.scan_settings WHERE username = 'test'

Any help is greatly appreciated!

I have now simplified the sql to be 'SELECT * FROM scan_settings' and I still have the same problem.


I was not including ulnet12.dll and ulnetclient12.dll in the app. Runs great now.


The error message seems to say that the database cannot make some comparisons it is being asked to make. For ISNULL, all expressions must be comparable (http://dcx.sybase.com/index.html#1201/en/dbreference/isnull-function.html). If the Dot, Distance, and Force_Change data types are not comparable to CHAR, that may be the issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜