2

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 ULCommand
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.

Nate Bunney
  • 2,418
  • 2
  • 22
  • 31

2 Answers2

2

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

Nate Bunney
  • 2,418
  • 2
  • 22
  • 31
0

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.

Tom Slee
  • 940
  • 1
  • 9
  • 13
  • Please note the last line in my post. "I have now simplified the sql to be 'SELECT * FROM scan_settings' and I still have the same problem." – Nate Bunney Jul 28 '11 at 14:44