populating blob field in navision from C++

jks
Member Posts: 277
Hi all,
I want to store a .bmp file to navision(field in navision is of type blob) from C++ program. How can i do that?
Is it possible to do this with cfront?
I am not able to use DBL_BLOB data type in cfront. I have declared one variable of type DBL_BLOB. but it gives me a compile time error that
DBL_BLOB undeclared identifier.
Please help.
I want to store a .bmp file to navision(field in navision is of type blob) from C++ program. How can i do that?
Is it possible to do this with cfront?
I am not able to use DBL_BLOB data type in cfront. I have declared one variable of type DBL_BLOB. but it gives me a compile time error that
DBL_BLOB undeclared identifier.
Please help.
0
Comments
-
probably by just saving the bmp to a file and import it with C/AL code. 8)
Probably you CAN do this when using MSSQL server ... i think this is well documenten somewhere in MSDN. (i once did this for MySQL and that was quite easy).
I think the DBL_BLOB datatype wont do the trick try and have a look at stream objects.In a world without Borders or Fences, who needs Windows and Gates?0 -
Warning! BLOB field in Navision is compressed by default. If you want to save data through external components, you must disable this compression on the field in Navision. Else you will get error about wrong compression in Navision... if you disable this property, you can save the data as standard BLOB data and use them in Navision...0
-
Hello Kine,
I have disabled compression. But still i don't know how to store blob data(picture image) from c++ application to navision.
Please help.0 -
It depend on which component you want to use for communicating with MS SQL server. ODBC, ADO etc. And you must learn how to work with this components... but sorry, this is not C++ forum... Navision part is ready, you must ask C++ experts how to work with MS SQL blob fields...0
-
Thanks kine for your help.0
-
And sorry, I forgot that you want to write the blob through C/Front - in this case you do not need to disable the compression, and it is not case for C++ experts... you are on right place... sorry to confusing you...
I have only example for VB, not for C++... and in VB is not problem the types of the variables, but you can be inspired by the code...VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 8565 ClientLeft = 60 ClientTop = 345 ClientWidth = 14775 LinkTopic = "Form1" ScaleHeight = 8565 ScaleWidth = 14775 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command1 Caption = "Command1" Height = 4095 Left = 2160 TabIndex = 0 Top = 1320 Width = 9375 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub Command1_Click() Dim hTable As Long Dim hRec As Long Dim picture1 As Variant Dim picture2 As Variant Dim name As Variant Dim cf As CFRONT Set cf = New CFRONTlib.CFRONT cf.CFrontDllName = "cfront.dll" cf.SetNavisionPath "c:\Program Files\Navision Attain\Client" cf.OpenDatabase "c:\Program Files\Navision Attain\Client\database.fdb", 1000, 1 cf.OpenCompany "CRONUS International Ltd." cf.OpenTable hTable, 5200 hRec = cf.AllocRec(hTable) If cf.FindRec(hTable, hRec, "-") = True Then cf.BWT picture1 = cf.GetFieldData(hTable, hRec, 19) cf.EWT End If If cf.FindRec(hTable, hRec, "+") = True Then cf.BWT cf.AssignField hTable, hRec, 19, picture1 cf.ModifyRec hTable, hRec cf.EWT End If MsgBox "ok", vbOKOnly, "ok" cf.FreeRec hRec cf.CloseTable hTable cf.CloseDatabase End Sub
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