Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Create a field definition file from VBA

Posted on 2007-04-10
9
Medium Priority
?
490 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 1000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

670 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