C/ODBC Connection with VB

Hi ! Im trying to change data in a Navision Database by using C/ODBC in Visual Basic 6. DAO 3.60. My code : 'Creating Workspacer with ODBC Connection Set wsMainWs = DBEngine.CreateWorkspace(“Test”, “super”, “pswd”, dbUseODBC) 'Connect to Navision Database Set dbDatenbank = wsMainWs.OpenDatabase("", False, 0, ODBCConnectionString) 'Open a Recordset with SQL Statement Set rsRecord = dbDatenbank.OpenRecordset("SELECT * FROM AnyTable, dbOpenDynamic, dbRunAsync, dbOptimistic) 'Start editting the record rsRecord.Edit 'Change data rsRecord.Fields(0).Value = NewValue 'Update Navision Databse with new data rsRecord.Update At this point Im getting an error message “ODBC call failed”. I havent found anything that helps to solve this problem. I tried all possible options with this method but nothing works. My second problem : Id like to use a file-DSN but the only connection I get is a user-DSN. Thank you for any help Karsten Fuchs

Thank you kindly ! But my companies proxy doesnt allow to connect to the page (it goes to The admin is in vacation. Maybe someone could be so kind to send me the page offline. My eMail is : Karsten.Fuchs@gob.de Karsten

A few points that might need your attention: Which version ODBC are you using? Experience learned that the 2.60 (+ HotFix) driver is most reliable. Why using DAO, not ADO for making the connection? The latter is the preferred method. Using the Data Project Wizard (selectable after “New Project”), you can make a fine connection in several ways (i.e. through datacontrols, or by code) and read/write to Navision tables. Use the wizard to get it up and running, then study/copy the code for your own project. John