NAVISION 2013 EXECUTE SQL QUERY

ALFEGO79
Member Posts: 10
Hi everybody
We are trying to exectue a query in Navision 20013, this database is SQL server but it isnt a Navision 20013, in fact its a integration.
Before, Navision 2009 we usually execute this code and it works:
Now, in Navision 2013 we dont have Microsoft Active X, so when we have tried to execute this query,we have this error, any suggest?
Thank very much.
We are trying to exectue a query in Navision 20013, this database is SQL server but it isnt a Navision 20013, in fact its a integration.
Before, Navision 2009 we usually execute this code and it works:
Now, in Navision 2013 we dont have Microsoft Active X, so when we have tried to execute this query,we have this error, any suggest?
Thank very much.
0
Answers
-
ALFEGO79,
You should be use ADO.NET if you are using ActiveX Data Objects (ADO).
http://msdn.microsoft.com/en-us/library/ms254937.aspx.
http://msdn.microsoft.com/en-us/library/vstudio/h43ks021%28v=vs.100%29.aspx
And you can refer sample code in CU104049 (Upgrade Upgrade601700.1 fob -- Version can be different).
Best Regards,
YukonMake Simple & Easy0 -
thank you
I ve got it a really easy way:
lrsRecordset := adoConn.Execute(ptxtSQL, lnRecCount, 0);
fFields := lrsRecordset.Fields;
lrsRecordset.MoveFirst;
REPEAT
prrRecRef.INIT;
//Arcaft
lfrField := prrRecRef.FIELDINDEX(1);
fFieldArcaft := fFields.Item(1);
ltArcaft := FORMAT(fFieldArcaft.Value);
lfrField.VALUE(ltArcaft);
//quantity
lfrquantity := prrRecRef.FIELDINDEX(2);
fFieldquantity := fFields.Item(0);
ltquantity := FORMAT(fFieldquantity.Value);
lfrquantity.VALUE(ltquantity);
prrRecRef.INSERT;
lrsRecordset.MoveNext;
UNTIL lrsRecordset.EOF;
lrsRecordset.Close;
adoConn.Close;0 -
Hello!
Does anybody faced the same issue as me?
I am running the SQL stored procedure from NAV, using ADO, it executes well. I have the Execute button on one of my pages.
My stored procedure is based on tables from NAV.
Then, I change something is the database, execute the same SP one more time, and get the result which not reflect the latest changes. For example, if I change customer Name, the SP returns me the old customer name.
Then I run the same SP in SQL Management Studio, it returns new customer Name. Moreover, when I click my Execute button on the RTC page after that, it also gives me the updated result.
Does anybody know where can be a problem?
Thanks in advance,
Maria0
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