Solved

Create a field definition file from VBA

Posted on 2007-04-10
9
478 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

820 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