emi_sastra
asked on
SOME SQL FUNCTION NOT ALLOWED WITH OLEDB CONNECTION
Hi All,
I try below code to transfer data from dbf to sql, some functions are not allowed.
ISNULL AND CASE RAISE ERROR.
Private Function Isi_Detil_Data_From_DP() As DataTable
sdbSQLCommand.AppendLine(" SELECT ")
sdbSQLCommand.AppendLine(" ISNULL(A.CAB, '') AS KOAO")
'sdbSQLCommand.AppendLine( ", CASE A.CAB WHEN '99' THEN '1' ELSE '2' END AS
sdbSQLCommand.AppendLine(" FROM " & strFileNameA & " AS A")
Dim strSQLCommand As String = sdbSQLCommand.ToString
Try
Dim accessDataSet As New DataSet()
Dim accessConnection As New OleDbConnection(strDBFFile Connection )
Dim accessAdapter As New OleDbDataAdapter(strSQLCom mand, accessConnection)
accessAdapter.Fill(accessD ataSet, "Data")
Return accessDataSet.Tables("Data ")
Catch ex As Exception
End Try
Return Nothing
End Function
What should I do ?
Thank you.
I try below code to transfer data from dbf to sql, some functions are not allowed.
ISNULL AND CASE RAISE ERROR.
Private Function Isi_Detil_Data_From_DP() As DataTable
sdbSQLCommand.AppendLine("
sdbSQLCommand.AppendLine("
'sdbSQLCommand.AppendLine(
sdbSQLCommand.AppendLine("
Dim strSQLCommand As String = sdbSQLCommand.ToString
Try
Dim accessDataSet As New DataSet()
Dim accessConnection As New OleDbConnection(strDBFFile
Dim accessAdapter As New OleDbDataAdapter(strSQLCom
accessAdapter.Fill(accessD
Return accessDataSet.Tables("Data
Catch ex As Exception
End Try
Return Nothing
End Function
What should I do ?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It works.
Thank you very much for your help.