Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Jul 24, 1998

Export Data to ISAM Databases

Use this code to get data out to different formats without requiring a complete copy of the DBMS on the user machine. Create a new project with a command button, and copy this code into the button's Click event:

 Dim db As Database
Set db = Workspaces(0).OpenDatabase _
	(App.Path & "\biblio.mdb")

' commented out syntax line followed by 
' working example
'	db.Execute "SELECT tbl.fields INTO 
'		[dbms type; DATABASE=path].[unqualified 
'		file name] FROM [table or tables]"

db.Execute "Select * into [dBASE III; 
	DATABASE=" & "C:\My Documents].
	[testa] FROM [authors]

By using the brackets and the dot operator, you get a completely proper output in the ISAM database type of your choice. Also, if you choose Text as the database type, the statement creates a SCHEMA.INI for you automatically, or adds a new section for your new data file to a SCHEMA.INI already in the path folder.
You can do any kind of export the client wants without using a DBMS on the machine. This makes your life easier when you notice that some users running Word 97 have problems mail-merging with text files you originally created with Write# and Print# methods.

Robert Smith
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date