Solved

Create a field definition file from VBA

Posted on 2007-04-10
9
474 Views
Last Modified: 2013-11-27
Is there a way to create a field definition file (ttx) or XML schema file (XSD) from an ADO recordset in VBA?  I can create an XML file using

rst.save "C:\file.xml" adPersistXML

But I need to schema file in order to use Crystal Reports the way I need it.  You can do this in .NET, but I can't find a solution for VBA (VB 6.0)  Thanks!
0
Comment
Question by:CyprexxDev
  • 6
  • 3
9 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 18884432
I think what you refer to as a field definition file is what MS refers to as a Schema.ini file for Microsoft Access.    
                 to make a schema.ini file from a db table
                  http://support.microsoft.com/kb/210001

                 to read a text file into a recordset using a schema.ini file
                 http://support.microsoft.com/kb/q149090/
Hope this helps.
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 18884498
Here is a good tutorial on exporting Access schema using XML:
                     http://articles.techrepublic.com.com/5100-6329_11-5035228.html
0
 
LVL 1

Author Comment

by:CyprexxDev
ID: 18884615
Your first link refers to schema.ini which is not what I need.  I need an XSD file.  Your second link provides this, but it's for use with Tables, Queries, etc...  I need to export an ADO recordset to an XSD file so this still will not work.  I have found a utility called xsd.exe which creates an XSD file from an XML file (which I can create from an ADO recordset), but this XSD file cannot be used in Crystal Reports - it tells me the file is not well formed.  

Moreover, I am going to have to do hundreds of these.  I'd think there was an easier way to connect Crystal Reports to an ADO recordset created in VBA code, but it seems they have nothing that works in this fashion which essentially makes CR useless for an Access or VB Application (unless the developer is using very simple techniques).  This is why I know something must exist, but nobody seems to know what it is.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 250 total points
ID: 18884923
This link might help:
         (#4664) How to Connect ADO Recordsets to Crystal Reports Designers
                         source code provided worked as is with version 8 of CR
                 http://vbcity.com/forums/faq.asp?fid=53&cat=Crystal+Reports
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 18885077
You might want to consider a commericial converter like this:
                     http://www.milestone.ca/access2crystal.asp?rmnu=Product&RetailSoftwareid=7#
                        free demo version allows you to convert 5 reports  ( costs $295 to buy full version)
0
 
LVL 1

Author Comment

by:CyprexxDev
ID: 18885249
That's almost exactly what I needed.  Thanks!  Access converters never work well, plus we don't have the original Access reports to convert (we're building this application from scratch based on the process flow of an existing aplpication).
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 18885296
Glad I could help.  
0
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 18887638
CyprexxDev,
Earlier tonight I happened to see your second post, but when I went back to try and read your request in detail, the post had been deleted.  Did you get what you needed from my answer above, or do you  need a different code set?
0
 
LVL 1

Author Comment

by:CyprexxDev
ID: 18891943
I figured out where to get the p2smon.dll file so I could create the TTX file from within my VBA code (based on an ADO recordset).  This pretty much has solved my problem.  I can get everything to work as needed now.  I'm sure I'll still have more questions as I go along though :-)  Thanks for all your help.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question