Re: Programatically use import wizard to import sdf file



The following knowledgebase article explains how to use it. If you
need command line access, then my SQLEXEC application will allow you to
do the import from the command line, without writing your own
application.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach@xxxxxxxxxxxxxxxxxxxx
http://www.goldstarsoftware.com
*** Austin: Pervasive Service & Support Class - 05/2006 ***
*** Chicago: Pervasive Service & Support Class - 07/2006 ***




ID: psql2430 - How do I use the Pervasive Import Wizard in my
application?

Description: How do I use the Pervasive Import Wizard in my application?
Environment: Pervasive.SQL 2000, Microsoft Visual Basic 6.0

Import Wizard
Solution: While accessing the COM object that encapsulates the
Pervasive Import wizard may work, it is not a recommended solution.
Below is code that shows how to access the Import Wizard from Visual
Basic v6.0 accessing the Import Wizard included with Pervasive.SQL
2000i SP3.
Note: The ImportWizard COM object will need to be added as a reference
in the Visual Basic project.

Dim oImportWizard As New ImportWizApp
With oImportWizard
Rem sets the format to read the imported file
..IsFormatSDF = 1
Rem sets the database name
..DBName = "DEMODATA"
Rem sets whether the first row has column names or not.
..IsColNamesFirstRow = 1
Rem sets the location (path and filename) for the file to be read.
..Path = App.Path & "\import.sdf"
Rem skips filled pages
..SkipFilledPages = 1
Rem sets the Pervasive table name data will be imported into.
..TableName = "TestTable"
Rem this actually starts the wizard.
..Run
End With
Set oImportWizard = Nothing

mbosco51@xxxxxxxxxxx wrote:

Hi. I am using Pervasive 8.6. Every couple of months we receive an
sdf file which we load to a table. To do this I use the import
wizard. I would like to automate this process. Is this possible?
After installing the clients tools, I noticed something called
ImportWizRSIApp under References in Visual Basic. It has attributes
like DBName, Path, ServerName, etc.... It looks like this would work
but I keep getting "ActiveX component can't create object" errors when
trying to invoke it. Since I haven't seen any documentation on this
component I'm not sure if it's possible to use it this way. Does
anyone have experience with this? Thanks.

.