Navision VB Integration

Dear

I want to integrate Visual Basic with Navision 4.0 Database

I have created DSN & now trying the connection thru ODBC,

If someone have do it earlier then please help me out.

Thanks

Ashish Bhardwah

Try MBS Navision - ODBC Connection Workbench v1.00

Read NODBC-Doku

And my personal CheckList:

  1. install N/ODBC driver
  2. Configure DataSource
  3. System Control/Managemant/Datensource (ODBC)
  4. User-DNS: Navision Database configuration (or create new source)
  5. Import Licence for Datasource
  6. Options: Language to Neutral (i have german version)

After this read something over standard ODBC in VB (.NET?) or ask a further question.

And if you realy want to “use VB in Navision” then check this video :slight_smile:

http://laputa.sharpdevelop.net/content/binary/SharpDevelopForApplications.wmv

Hi Ashish,

I’ve do a test previously, and it’s working, but with vb 6.0

Do you try with VB or .NET ?

wich kind of information do you need ?

Regards,

Luc

Your link is to a password protected video. I could not access it,

?

It’s an open video.

But try http://laputa.sharpdevelop.net/AnnouncingSharpDevelopForApplicationsSDA.aspx

Dear

Can you please suggest the way to do it with ver 6.0

thanks

Ashish

Ashish,

1°) You need to configure an ODBC driver to navision (DSN) (with or without givving the sql database or the path of the database if native database)

2°) in VB

  • you need a reference to the DAO library

and declare the vairable

Public dbs As DAO.Database

  • Connect to the database like this sample:

Set dbs = OpenDatabase("", False, False, “ODBC;DSN=Navision;uid=xxx;pwd=xxxx”)

  • Sample to see the list of table in the database

place a List Box on a form and use this code

Sub ListTab()
Dim tbdf As TableDef

FrmDBViewer.cmbListeTables.Clear
FrmDBViewer.LstTables.Clear

For Each tbdf In dbs.TableDefs
FrmDBViewer.cmbListeTables.AddItem tbdf.Name
Next

End Sub

Place a DataGrid Control on the form and

Sub visualiser()
Dim rsTest As Recordset

On Error Resume Next

Set rsTest = dbs.OpenRecordset("SELECT ‘No.’,‘Name’ FROM " & FrmDBViewer.cmbListeTables.Text & “;”)

rsTest.MoveLast
MsgBox rsTest.RecordCount

Set FrmDBViewer.DtGrd1.DataSource = rsTest
FrmDBViewer.DtGrd1.Refresh

rsTest.MoveFirst

With rsTest
Do While Not .EOF

MsgBox "No. : " & rsTest.Fields(0).Value
.MoveNext
Loop
End With

rsTest.Close
Set rsTest = Nothing

End Sub

  • Disconnect from the database like this sample :

dbs.Close
Set dbs = Nothing

It’s a sample, I hope’s that help you.

Dear Hebus

Thanks for the reply

one more way I have tried with ADODC for that i have used its property & linked with the Navision ODBC Data Source Name & specify the Table in recordSource & then created a form where i have used the Text boxes linked with ADODC & Datafield property.

Also i have placed the datagrid & make it’s Datasource Property to ADODC.

It’s working fine.

I will also check your method.

Thanks

Ashish

Hi,

can anyone tell me, how to connect to Navision database version 3.56 through ASP pages? I set the DSN and wanted to run the following:

strDSN = “aaa”
strUser = “bbb”
strPwd = “ccc”
Set conn = Server.CreateObject(“ADODB.Connection”)
conn.open strDSN,strUser,strPwd

But it didn’t work. Has anyone experience in this? Thanks!