Question for dealing with external data through ADO
jelittlejohn
Member Posts: 61
Hi,
I am currently using an ADO automation object to import order information from an external MySQL database. This works great. However, every so often an order is imported with data that does not pass internal NAV validation and an error is thrown. This is fine within NAV. I have error handling setup so the routine can move on to the next order and rights a record telling the user there was an error with the order in question. The problem is that when these errors arise, the ADO object never makes it to the Close command and that particular connection is left hanging open. Over time this causes some problems with the external database.
I know that I should grab the external data, assign it to a NAV variable and immediately close the connection but I have set up the whole thing to just grab each piece of external data from the ADO recordset only as it's needed and wait til processing is complete to close it. I would love to avoid the work involved with changing this.
Does anyone know of any way that I can close all open ADO or ODBC connection from a NAV session or from the client machine as a whole? I still have control from the calling codeunit of may error handling routine but I no longer have access to the variable name of the ADO session.
Thanks in advance for any ideas.
I am currently using an ADO automation object to import order information from an external MySQL database. This works great. However, every so often an order is imported with data that does not pass internal NAV validation and an error is thrown. This is fine within NAV. I have error handling setup so the routine can move on to the next order and rights a record telling the user there was an error with the order in question. The problem is that when these errors arise, the ADO object never makes it to the Close command and that particular connection is left hanging open. Over time this causes some problems with the external database.
I know that I should grab the external data, assign it to a NAV variable and immediately close the connection but I have set up the whole thing to just grab each piece of external data from the ADO recordset only as it's needed and wait til processing is complete to close it. I would love to avoid the work involved with changing this.
Does anyone know of any way that I can close all open ADO or ODBC connection from a NAV session or from the client machine as a whole? I still have control from the calling codeunit of may error handling routine but I no longer have access to the variable name of the ADO session.
Thanks in advance for any ideas.
Jack Littlejohn
Clemson, SC
Clemson, SC
0
Comments
-
You could connect to the other database and get a list of non active session and issue a kill statement?
Is the other db sql?0 -
It is MySQL.
I like the idea and will look into it. If you have any helpful hints or code snippets (even if they are for SQL), I would appreciate it. I might consider creating t his function and having it run once daily in the middle of the night.
Thanks again.Jack Littlejohn
Clemson, SC0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
