VB, ODBC, ADO and Navision

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 don’t think that your problem is ODBC related. Wrong interpretation of decimal values is usually the case if the comma is set as default decimal character instead of the dot. This is by default the case with German and Austrian Windows versions. Check your country settings, change the decimal character to ‘.’ and try again after reboot. Viel Glück! Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch

It’s a mistake still made too often in VB. From the old days of DOS basic, VB inherited the VAL() function to make a numerical from text. But this function knows the American notation only. The correct method to use in VB is one of the “C” convertors, like CInt, CLong, CCurr, etc. These are “international aware” which means they understand the local settings for separator and decimal character. John

I have a problem very similar. When i try get a decimal value the ODBC reponse: Failure ODBC!!! With another variables types haven´t problem Thanks

Thank you all for your help. My solution : After reinstalling C/ODBC 2.60 everything worked fine an decimal places were right. But now ive another error. When I try to update a CODE field I get an ISAM error. Still dont know what ISAM means. It seems to be the error for everything. My Code : rsServiceKomponenten.Open "SELECT * FROM Serv__Aktiv__Komponente ", cnODBC, adOpenDynamic, adLockOptimistic 'Opens a recordset rsServiceKomponenten.Fields(“Nr_”).Value = “Test” 'Nr_ has Navision datatype : CODE 20 rsServiceKomponenten.Update 'ISAM error rsServiceKomponenten.Close 'Closes the recordset If theres anyone who knows about that problem please contact me. Thank you for any advice. Karsten Fuchs

Unfortunately I cannot help you with your ADO problem but at least I know what ISAM means: Index Sequential Access Method. In other words: The connection to the database has been established but a call to the db failed. Typical cases are Get of a record which doesn’t exist, read beyond EOF etc. Regards Marcus

ISAM is a middle layer of the way C/ODBC handle the SQL calls. While you get ISAM error gernerally means the update statement that your ADO sent to C/ODBC can’t be executed on the benether database. Therefore, it will be more cleary if you can trace down to see the exact sql statement was sent. The basic tool is go to Control Pane\ODBC\ and enable trace, which will catch all the sql API calls from your code to odbc.