database tables report to word document????

database tables report to word document????

Post by Bara » Thu, 25 Jan 2001 04:42:22



Hi !

Does anyone know any script that generate report of the DB
table, columns, datatypes etc to a word or excel document?

Thanks
Barak Mery

 
 
 

database tables report to word document????

Post by Dion » Thu, 25 Jan 2001 10:01:43


Hi Barak,

My method is not stright forward, but perhaps could work for you. Just
create a SQL script for all tables you want, taking away the DROP statement.
Save it and open it with Word 97 or 2K.

After this, run the macro bellow on the document, copy it and paste it in
XL. It does not look perfect, but...

Hope this helps.
Regards,
Dioni

Macro Code:
---------------------------------------------------------------

Sub PrepareSQLStatement()
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = " (^p"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "CREATE TABLE [dbo].["
        .Replacement.Text = ""
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "NOT NULL"
        .Replacement.Text = "NOTNULL"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = ",^p"
        .Replacement.Text = "^p"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = " ^p"
        .Replacement.Text = "^p"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = ")^pgo^p^p"
        .Replacement.Text = "^p^p"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "] ("
        .Replacement.Text = "]("
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "^w"
        .Replacement.Text = "^t"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "["
        .Replacement.Text = ""
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "]"
        .Replacement.Text = ""
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    With Selection.Find
        .Text = "notnull"
        .Replacement.Text = "not null"
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub

 
 
 

1. Filemaker record to word document and word document list

Hello you filemakerlovers
I have a problem
I want to export 1 record to a word letter
If I select a customer record that I want to send a letter all the data of
the client like his name and address must be copied in the letterhead.
Have you done this or is there a programme for...
and my second problem
I wont to see witch letters I send to that customer.
A list off all the letters must be appearing
thanks if you have done this before...

2. Anther Question

3. Save a vfp 3/5 report to word /excel etc document

4. Defrag

5. Generating word document files from embedded documents in Access or SQL Server DB.

6. BOOK Object Databases: An Introduction

7. Word objects from Acces via VB6 to WORD document

8. Connection In Use

9. OLE Automation of Word Document from MSDE Table

10. Word Documents stored in SQL tables

11. Insert word document into table

12. Embedding a Word document in a SQL Server 7 table column

13. Add a word document to table