Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Access Data into a Paradox table

Status
Not open for further replies.

woodyinoz

IS-IT--Management
Jan 8, 2002
215
GB
I have written the following code in an attempt to automatically copy data from and Access table into a Paradox table:-

method pushButton(var eventInfo Event)
var
dtHandle DataTransfer ;// handle to transfer variable
tvTable TableView ;// tmp handle for displaying imported file
endVar

;// Set notification for user
setMouseShape(MOUSEWAIT, TRUE)

dtHandle.setSource "C:\\WINDOWS\\Desktop\\LittleFolder\\TestStuff\\material.mdb", dtASCIIVar)
dtHandle.setSourceCharSet(dtANSI)

;// Enable the key violation and problems tables
;//
dtHandle.setKeyViol(TRUE)
dtHandle.setProblems(TRUE)


;// We are always appending in this script since we force
;// the destination table to always exist
;//
dtHandle.setDest("MatMan.DB")
dtHandle.setAppend(TRUE)

;// Perform the import
;//
dtHandle.transferData()

;// Reset cursor for the user
;//
setMouseShape(MOUSEARROW, TRUE)

;// Display table
;//
tvTable.open("MatMan.DB")

endMethod

However, this code returns the following error - "Corrupt file - Other than header". Despite recieving this message I know that the file is not actually corrupt so am looking either for an alternative way of doing this or any suggestions as to why my code is reulsting in this error.

Thanks,

Woody.
 
As an additional point - this error message only occurs when the Access file has been moved from its original directory. When run from its original directory the error message "Table Busy" is reported (which is correct because the table is always in use by another application). Why is this?

Woody.
 
I assume you are getting this error when you try to display the table at the end of the script, but have you set a breakpoint and stepped through the script to make sure? Another question is: did you try to open the "Matman.db" file in native Paradox to see if it is actually corrupt?

Mac
Mac
:)
 
Woody,

As an alternative solution you could just create an ODBC link then capture the table structure and contents via either QBE or SQL?

Regards

Bystander
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top