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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

importing Paradox tables into an Access DB

Status
Not open for further replies.

SueHunting

Programmer
Aug 24, 2001
5
GB
I have a Paradox DB with tables which include Formatted Memo fields. Access cannot deal with these so I have changed them, in Paradox, to Memo fields. However, on importing, there are lots of peculiar (presumably formatting) characters left. Is it possible to get rid of these on or before importing?
 
Arrrrgh. Paradox !!! Which one, Btreive ???

Did you install the data conversion add in ?? c:\Off97\ValuePak\DataAcc ??? That has a paradox converter in it.

Otherwise, I would check for spaces, Line Feeds, etc. Or, any chracter over number 128 using the chr() and/or asc() functions. Here's an example that you would have to modify to suit your needs:

Public Sub FindForiegn()
Dim DBS As Database
Dim RST As Recordset
Dim RST1 As Recordset
Dim I As Integer
Dim X As Integer
Dim StringLength As Integer
Dim Char
Dim FoundFile
Set DBS = CurrentDb 'Instanciate DBS object
Set RST = DBS.OpenRecordset("Table Name") ‘Note, you could pass this in also
Set RST1 = DBS.OpenRecordset("tblFields") ‘Or, as an alternate, create a new tableDef
With RST
'Go to first record. You may want to check for -1 (blank recordset)
.MoveFirst
Do While Not .EOF
'One to number of fields in recordset
For I = 1 To .Fields.Count - 1
'Make sure the fields not blank
If .Fields(I).Value <> &quot;&quot; Then
'Set the variable to the fields value
FoundFile = .Fields(I).Value
'Count the characters in the string
StringLength = Len(FoundFile)
'Loop through the string
For X = 1 To StringLength
'One character at a time
Char = Asc(Mid(FoundFile, X, 1))
'If it's not 1-128
If Char > 128 Then
With RST1
'Add it to the table
.AddNew
!Bill = RST.Fields(1).Value 'This was a bill to ID field
!Ship = RST.Fields(2).Value 'This was a Ship to ID field
!Field = RST.Fields(I).Name 'The name of the field the character was found in
!CharText = Chr(Char) 'The text of the character found
!CharNum = Char 'The number of the character found
!Word = FoundFile 'The word the chracter was found in
'Don't forget to update or your write won't be saved
.Update
End With
Else
End If
Next X
Else
End If
Next I
'Go to the next record in the recordset
.MoveNext
'Do the whole thing over again
Loop
End With
End Sub

Tyrone Lumley
augerinn@gte.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top