Parameters and ADO
warrax
Member Posts: 25
Hi
I'v read through a LOT of the comment here on the Forum, but I'm still stuck. I want to call a Stored Procedure and pass it one Parameter, and get another one back - it's NOT stored in a table. How do I do it? (Code please).
[-o<
Thanks
I'v read through a LOT of the comment here on the Forum, but I'm still stuck. I want to call a Stored Procedure and pass it one Parameter, and get another one back - it's NOT stored in a table. How do I do it? (Code please).
[-o<
Thanks
0
Comments
-
If you can find ADO-code on the net, you can translate this to C/AL, and do it that way.
But Navision has problems handling errors from ADO objects. After error in stored procedure (or SQL command), you have to restart Navision Client (or NAS), because every ADOCommand.Parameters.Append throws error.
It's better to create activex dll and use ADO from within it. Look here:
http://www.mibuso.com/forum/viewtopic.php?t=37520 -
Hi
Can someone maybe tell me what's wrong with this code:
Parameters:-
ADO_Connection 'Microsoft ActiveX Data Objects 2.8 Library'.Connection
ADO_Command 'Microsoft ActiveX Data Objects 2.8 Library'.Command
ADO_Parameters 'Microsoft ActiveX Data Objects 2.8 Library'.Parameters
ADO_Parameter 'Microsoft ActiveX Data Objects 2.8 Library'.Parameter
ActiveConnection Text 30
lCommandText Text 1024
IF ISCLEAR(ADO_Connection) THEN CREATE(ADO_Connection); ADO_Connection.ConnectionString := 'Provider=SQLOLEDB;Integrated Security=SSPI;Data Source=NAVSVR1;Initial Catalog=SQLAdminDB'; ADO_Connection.Open; IF ISCLEAR(ADO_Command) THEN CREATE(ADO_Command); ADO_Command.ActiveConnection := ADO_Connection.ConnectionString; ADO_Command.CommandTimeout:=0; ADO_Command.CommandType:=4; IF ISCLEAR(ADO_Parameter) THEN CREATE(ADO_Parameter); ADO_Parameters := ADO_Command.Parameters; ADO_Parameter := ADO_Command.CreateParameter('@Password',3,4,0); ADO_Parameters.Append(ADO_Parameter); Password := ''; lCommandText := STRSUBSTNO('sp_navadmin_addlogin_Navision %1, @Password output', pUserID); ADO_Command.CommandText := lCommandText; ADO_Command.Execute; Password := ADO_Parameter.Value; ADO_Connection.Close; CLEAR(ADO_Connection);
Thanks0 -
http://www.mibuso.com/forum/viewtopic.p ... +parameter
and this is not the only one thread about same topic
0
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
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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
