The problem here is that the convert function below gives me an error in the ODBC data string. The SQL string works fine!!!
Here is the error message I get at execution on console:
error: ERROR [42000] [Microsoft][ODBC Text Driver] Undefined function 'convert' in expression.
CONVERT(varchar(8), fld_time, 8)
Dim MyDataAdaptor As New System.data.sqlclient.SqlDataAdapter("select fld_date, CONVERT(varchar(8), oldtime, 8)as fld_time, fld_od, fld_max, fld_min, fld_ovality from tbl_data_laser_1", connect)
MyDataAdaptor = New System.data.Odbc.OdbcDataAdapter("select fld_date,CONVERT(varchar(8), oldtime, 8) as fld_time, fld_od, fld_max, fld_min, fld_ovality from [" + strFilename + "]", connect)
Any ideas?
BTW, If I drop the convert function from the ODBC string It works just fine .... but my data (time) is shown as a date, hence the need to convert it. I have tried thr format function but couldn't get it to work
TIA
jeff
Here is the error message I get at execution on console:
error: ERROR [42000] [Microsoft][ODBC Text Driver] Undefined function 'convert' in expression.
CONVERT(varchar(8), fld_time, 8)
Dim MyDataAdaptor As New System.data.sqlclient.SqlDataAdapter("select fld_date, CONVERT(varchar(8), oldtime, 8)as fld_time, fld_od, fld_max, fld_min, fld_ovality from tbl_data_laser_1", connect)
MyDataAdaptor = New System.data.Odbc.OdbcDataAdapter("select fld_date,CONVERT(varchar(8), oldtime, 8) as fld_time, fld_od, fld_max, fld_min, fld_ovality from [" + strFilename + "]", connect)
Any ideas?
BTW, If I drop the convert function from the ODBC string It works just fine .... but my data (time) is shown as a date, hence the need to convert it. I have tried thr format function but couldn't get it to work
TIA
jeff