Solved

Create a field definition file from VBA

Posted on 2007-04-10
9
470 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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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 improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views 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 Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now