c/odbc visual basic .net

aiserte
Member Posts: 2
I am trying to update a table using CODBC connection in .NET.
I am able to connect to Navision Database and I am be able to read data
But If I try to update the database with the following code
Dim conStr As String = "DSN=Navi;CN=company;UID=user;CC=Yes;NType=tcp;RO=No;OPT=Text;BE=Yes;SName=ip;IT=All Characters;PPath=C:\program files\Navision Financials;QTYesNo=Yes;SERVER=N;CSF=Yes"
Dim myConnection As New OdbcConnection(conStr)
myConnection.Open()
Dim myCommand As OdbcCommand = myConnection.CreateCommand()
Try
Dim sql As String
sql = " INSERT INTO ""TABLE"""
sql = sql & " (""FIELD1"", ""FIELD2"", "
sql = sql & " ""FIELD3"", ""FIELD4"", "
sql = sql & " ""FIELD5"", ""FIELD6"", "
sql = sql & " ""FIELD7"", ""FIELD8"", "
sql = sql & " ""FIELD9"", ""FIELD10"", "
sql = sql & " ""FIELD11"", ""FIELD12"") "
sql = sql & " values ('27', '27', '27', '2006/03/16', '2006/03/16', 'b', 'c', 'd', 'e', 'f','g', 'USER' ) "
myCommand.CommandText = sql
myCommand.ExecuteNonQuery()
Catch ex As Exception
Try
Console.WriteLine("An exception of type " & ex.GetType().ToString() & _
"was encountered while inserting the data.")
Console.WriteLine("Neither record was written to database.")
Finally
myConnection.Close()
End Try
Now If I run the program it gives me an error that
Driver does not support this function
Although the data was inserted.
Can any one help me through
Thanks
I am able to connect to Navision Database and I am be able to read data
But If I try to update the database with the following code
Dim conStr As String = "DSN=Navi;CN=company;UID=user;CC=Yes;NType=tcp;RO=No;OPT=Text;BE=Yes;SName=ip;IT=All Characters;PPath=C:\program files\Navision Financials;QTYesNo=Yes;SERVER=N;CSF=Yes"
Dim myConnection As New OdbcConnection(conStr)
myConnection.Open()
Dim myCommand As OdbcCommand = myConnection.CreateCommand()
Try
Dim sql As String
sql = " INSERT INTO ""TABLE"""
sql = sql & " (""FIELD1"", ""FIELD2"", "
sql = sql & " ""FIELD3"", ""FIELD4"", "
sql = sql & " ""FIELD5"", ""FIELD6"", "
sql = sql & " ""FIELD7"", ""FIELD8"", "
sql = sql & " ""FIELD9"", ""FIELD10"", "
sql = sql & " ""FIELD11"", ""FIELD12"") "
sql = sql & " values ('27', '27', '27', '2006/03/16', '2006/03/16', 'b', 'c', 'd', 'e', 'f','g', 'USER' ) "
myCommand.CommandText = sql
myCommand.ExecuteNonQuery()
Catch ex As Exception
Try
Console.WriteLine("An exception of type " & ex.GetType().ToString() & _
"was encountered while inserting the data.")
Console.WriteLine("Neither record was written to database.")
Finally
myConnection.Close()
End Try
Now If I run the program it gives me an error that
Driver does not support this function
Although the data was inserted.
Can any one help me through
Thanks
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions