How to understand the DB Concepts in VB.Net? (VSTO) (1 Viewer)

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 23:36
Joined
Mar 22, 2009
Messages
785
Hi Guys,
I have more than 13 years of experience in VBA and also using Ms Access Databases as backends. Recently decided to utilize the VSTO Word Document features to create rich reports (Ms Access Reporting Tools are very limited when comes to formatting). What's the Challenge then?

With Ms Access everything is simple:
Just declare a recordset.
Load it
and Use it.

But so far in my exploration with VB.Net:
There are 4 things are being created and involved:
Dataset
TableAdapter
TableAdpater Manager
and Binding Source.

My Exact Current requirements:
There should be a Macro-Enabled VSTO word document (*.docm)
which on opening has to print the last record of a Bill (Query Name is Bills)

Other features:
Feature No.1:
I have a sales form inside an Ms Access Database. Upon the clicking on a button the VSTO word Document has to open and print the last bill and quit.
Feature No.2:
The above feature has to be done invisibly but if I open the word Document, it has to have action pane having a Navigator in it settling on the last bill number by default but I want the navigator control to also have the general navigation features like: "|<< < > >>| >*" with a print Button to print the navigated bill using that control.

I know its a bit long post but I wanted to explain in details as much as I can. Thanks. Please reply and Provide Support.

With Hope,
Prabhakaran
 

GPGeorge

George Hepworth
Local time
Today, 11:06
Joined
Nov 25, 2004
Messages
1,904
Hi Guys,
I have more than 13 years of experience in VBA and also using Ms Access Databases as backends. Recently decided to utilize the VSTO Word Document features to create rich reports (Ms Access Reporting Tools are very limited when comes to formatting). What's the Challenge then?

With Ms Access everything is simple:
Just declare a recordset.
Load it
and Use it.

But so far in my exploration with VB.Net:
There are 4 things are being created and involved:
Dataset
TableAdapter
TableAdpater Manager
and Binding Source.

My Exact Current requirements:
There should be a Macro-Enabled VSTO word document (*.docm)
which on opening has to print the last record of a Bill (Query Name is Bills)

Other features:
Feature No.1:
I have a sales form inside an Ms Access Database. Upon the clicking on a button the VSTO word Document has to open and print the last bill and quit.
Feature No.2:
The above feature has to be done invisibly but if I open the word Document, it has to have action pane having a Navigator in it settling on the last bill number by default but I want the navigator control to also have the general navigation features like: "|<< < > >>| >*" with a print Button to print the navigated bill using that control.

I know its a bit long post but I wanted to explain in details as much as I can. Thanks. Please reply and Provide Support.

With Hope,
Prabhakaran
This has the feel of trying to adapt a V8 engine to power a bicycle. Sure, it's got a lot of horsepower, but managing it is anything but convenient.
 

Josef P.

Well-known member
Local time
Today, 20:06
Joined
Feb 2, 2023
Messages
829
You could also create a COM-Add-In for Word with twinBasic, then you stay with your known language.

Note:
ADO.net is completely different from ADODB or DAO.
If you want to familiarize yourself with .net, I would rather put the effort into learning C#.
 

Edgar_

Active member
Local time
Today, 13:06
Joined
Jul 8, 2023
Messages
432
OP, you're trying to drive a tank to the lake to attempt to catch a fish with a 20m x 20m fishnet.

You would ease a lot of the pain by letting Access do the Recordset stuff and letting Word do the reporting. Use a Word template and populate it using the Find & Replace method (not the bookmarks method) from Access, similar to what Tom says.

Scenario 1 (convoluted):
  1. User finishes entering data and wants to create a report.
  2. Opens a Word document.
  3. The document unexpectedly prints the last record.
  4. User navigates to the desired record in Word.
  5. Either prints the record or manipulates it to become the last record for future printing.
  6. Repeats this process.
  7. To share the .docm file, user may convert it to .docx.
  8. Additional steps for sharing: Save the file, select "Save As," choose .docx format, and share.

Scenario 2 (straight forward, no training, users expect this):
  1. User finishes entering data and wants to create a report.
  2. Clicks "make report" button.
  3. A code-free file is instantly generated, ready to be shared or discarded.
  4. To report another record, user simply navigates within the application and clicks "make report" again.
  5. Generated files are easily shared, similar to exporting a bank statement from a banking app.

Please excuse me if I don't have the full picture, I added some exaggerations but I hope to make you see that it is possible but too convoluted to pass recordset capabilities to Word, just to do something that can be done from the "main" app. Please consider Word already does something very similar called "mail merge", which lets your users browse records, but it's buggy as hell.
 

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 23:36
Joined
Mar 22, 2009
Messages
785
Initially I was trying the mail merge feature only. But the problem is you cannot suppress the query dialog box before the document gets merged.

Why VSTO?
Evolution!

Let me explain, How VSTO makes things easier here. No:1 Lot of code saving thus less code and faster result.

Next, I want to understand the Database concepts (especially read-only Binding) in VB.Net i.e. from Fetching the data from a table to display it on a control. I want to understand both the sides Design time and Runtime to achieve the same result. I strongly believe that atleast single person must have mastered it here. Either this post has to reach him/her or the Person has to read this post. I have strong hope. Lets wait and see...
 

Users who are viewing this thread

Top Bottom