Exporting MS Access data to be imported into RoboHelp

  • Thread starter Thread starter Perry
  • Start date Start date
P

Perry

Our existing knowledge base articles are stored within an
MS Access database (via an application called PropWeb). We
want to convert all these articles over to RoboHelp. The
content for each article is located in an Access table
called PROP, all in html code within each record (which
PropWeb then displays to a user using a web interface).
Each article within this table may also include references
or links to various attachments (which are separate files
outside of the database). The attachments could be JPG
images or PDF files, etc.

The problem I am running into is fundamentally an Access
export issue...

MS Access as the ability to export to different file
formats, including HTML and RTF. However, the resulting
file contains all the data in a large table. I don't want
to import a HUGE table as a single topic into RoboHelp. I
want each record separated out into it's own topic.

Does anyone have any experience with this? Has anyone
successfully converted PropWeb articles over to RoboHelp?
If not, does anyone know how to convert an MS Access
database so each record can be imported into RoboHelp as a
separate topic? Help! I would rather not have to do this
by cutting and pasting it all one by one.
 
Hi Perry,

A simple way of doing it is to use the function below in a calculated
field in a query. It returns a value, but as a side effect it creates a
textfile containing the value you pass it.

The calculated field will look like this:
ExportError: WriteToFile([XXX], YYY)
where XXX is the name of the field that contains the HTML for the help
topic and YYY is specifies the path and name of the file you want to
create.

For YYY, you could use a suitable field from the PropWeb table (let's
call it TopicID) in an expression like this
"D:\Folder\Subfolder\" & [TopicID] & ".txt"

This code has worked OK every time I've used it, though I haven't tried
it with very large datasets. In recent versions of Access (Access 2003
especially) it may provoke warnings from the macro security system; if
so, you'll need to partially disable it for the duration (and re-enable
it afterwards), or else use a more roundabout approach.


'Code starts
Public Function WriteToFile(Var As Variant, _
FileSpec As String, _
Optional Overwrite As Long = True) _
As Long
'Writes Var to a textfile as a string.
'Returns 0 if successful, an errorcode if not.
'By John Nurick, 2003

'Overwrite argument controls what happens
'if the target file already exists:
' -1 or True (default): overwrite it.
' 0 or False: append to it
' Any other value: abort.

Dim lngFN As Long

On Error GoTo Err_WriteToFile
lngFN = FreeFile()
'Change Output in next line to Append to
'append to existing file instead of overwriting
Select Case Overwrite
Case True
Open FileSpec For Output As #lngFN
Case False
Open FileSpec For Append As #lngFN
Case Else
If Len(Dir(FileSpec)) > 0 Then
Err.Raise 58 'File already exists
Else
Open FileSpec For Output As #lngFN
End If
End Select
Print #lngFN, CStr(Nz(Var, ""));
Close #lngFN
WriteToFile = 0
Exit Function
Err_WriteToFile:
WriteToFile = Err.Number
End Function
 
Back
Top