VB, ODBC, ADO and Navision once again

Karsten_Fuchs
Member Posts: 4
Hi,
I try to invent a complete connection to a Navision database through ODBC with ADO. Through this connection I want to acces a table and add, delete and change a recordset.
My Code :
Set cnODBC = New ADODB.Connection
cnODBC.Open "DRIVER={C/ODBC 32 bit};CSF=No;Database=C:\Anywhere;PPATH=C:\Anywhere;UID=SUPER;PWD=any;CN=any;IT=a-z,A-Z,0-9,_"
'I use this kind of IT because nothing else worked e.g. All characters
Set rsTable = New ADODB.Recordset
rsTable.CursorType = adOpenDynamic
rsTable.LockType = adLockPessimistic
rsTable.Open "SELECT * FROM Serv__Aktive__Komp_", cnODBC
Now my problem :
Variables from Navision with datatype decimal have wrong values in VB. e.g. Navision decimal value is 8,25 with 0:5 decimal places. In VB the value is 825000.
The kind of identifier (a-z,A-Z,0-9,_) I use is the only working one.
Thank you for any support.
I try to invent a complete connection to a Navision database through ODBC with ADO. Through this connection I want to acces a table and add, delete and change a recordset.
My Code :
Set cnODBC = New ADODB.Connection
cnODBC.Open "DRIVER={C/ODBC 32 bit};CSF=No;Database=C:\Anywhere;PPATH=C:\Anywhere;UID=SUPER;PWD=any;CN=any;IT=a-z,A-Z,0-9,_"
'I use this kind of IT because nothing else worked e.g. All characters
Set rsTable = New ADODB.Recordset
rsTable.CursorType = adOpenDynamic
rsTable.LockType = adLockPessimistic
rsTable.Open "SELECT * FROM Serv__Aktive__Komp_", cnODBC
Now my problem :
Variables from Navision with datatype decimal have wrong values in VB. e.g. Navision decimal value is 8,25 with 0:5 decimal places. In VB the value is 825000.
The kind of identifier (a-z,A-Z,0-9,_) I use is the only working one.
Thank you for any support.
0
Comments
-
Ok. I solved the problem. But now ive a newer one for you.
After opening a recordset a Navision CODE field, length 20 has its Recordset.Fields(index).DefinedSize property set to 21. Ok, thats not the problem I could handle this. But after setting the Recordset.Fields(index).value to e.g. "Hello" the property is automatically set to "Hello " --> = (21-Len("Hello")) empty spaces. The length overall is 21 and updating the recordset causes an ISAM error.
Any help ?
Thanks0 -
Hi,
I'm using the INSERT INTO statement of sql. Everything is working fine only when I try to put a value into a decimal datatype.
I have the same problem
"
Variables from Navision with datatype decimal have wrong values in VB. e.g. Navision decimal value is 8,25 with 0:5 decimal places. In VB the value is 825000.
"
How did you fixed that problem??
Bart0 -
I have set the default settings to decimal symbol to "." and grouping symbol to ",".
btw i try them all.
But he gives me an error in module CODBC.DLL
any suggestions??
<img border="0" title="" alt="" src="images/smiles/icon_confused.gif" />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