0

I have an application written in VB.NET that collects information from an SQL/MX database via an ODBC driver. All works fine except for one specific table that contains two INTERVAL DAY(2) fields. When I run the query for this table I get an 'Unknown SQL type - 103' error. If change my query to exclude these fields then it works fine.

Dim SQLQueryDataAdapter As New OdbcDataAdapter(MySQLQuery, MyNonStopConnection)
Dim SQLQueryOutputTable As New DataTable("SQLOutput")
SQLQueryDataAdapter.Fill(SQLQueryOutputTable)

My ODBC connection string:

MyNonStopConnection = New OdbcConnection(
        "Driver=" & MyDriver & ";DSN=" & MyDSN & ";SERVER=TCP:" _
        & MyTCP & ";UID=" & MyUserName & ";PWD=" & MyPassword)

MyNonStopConnection.Open()

What am I doing wrong?

Kjartan
  • 18,591
  • 15
  • 71
  • 96
Rico Strydom
  • 537
  • 1
  • 6
  • 26

2 Answers2

0

Not all data types get through ODBC correctly (depending upon flavour of SQL and driver). You may need to CAST the fields in question as a more standard type.
What driver are you using?

AjV Jsy
  • 5,799
  • 4
  • 34
  • 30
0

What is the MAXIMUM number of days you expect to log as the INTERVAL?

To me it looks like either your precision or data type length is incorrect for your SQL Interval Field? so one would be tempted to ask how you defined the field type? in your table record.

Ref: http://msdn.microsoft.com/en-us/library/windows/desktop/ms716230(v=vs.85).aspx

Zeddy
  • 2,079
  • 1
  • 15
  • 23