VB, ODBC, ADO and Navision once again

Karsten_FuchsKarsten_Fuchs Member Posts: 4
edited 2002-01-22 in Navision Financials
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.

Comments

  • Karsten_FuchsKarsten_Fuchs Member Posts: 4
    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 ?
    Thanks
  • bartwyckmansbartwyckmans Member Posts: 39
    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??

    Bart
  • bartwyckmansbartwyckmans Member Posts: 39
    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" />
Sign In or Register to comment.