Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 23rd, 2005, 12:47 PM
Friend of Wrox
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem scanning over all non system table

Hi guys i wrote a vba code that supposed to
go find all non system tables in access 2000 db
and generate corresponded create table statements for them.
Unfortunately when i run the program it misses one of the
tables called committee members and also uses one of
table names 2 time.Furthermore, instead of using table names it
uses first columns of each table in generating table name for createing table statement.
I be happy if some expert help me fix this bug in my vba program.Thanks

http://i5.photobucket.com/albums/y18...tenissvba1.jpg ( teniss club db reletions )

http://i5.photobucket.com/albums/y18...tementvba2.jpg (genrated create table statements)

Private Sub CreateTableButton_Click()
    Dim T As TableDef
    Dim db As Database, cont As String
    Set db = CurrentDb()
    For Each T In db.TableDefs
        If Left(T.Name, 4) <> "MSys" Then
           ' 'If T.Name = Me.ComboBox Then
                pk = Left(GetPK(T, db), InStr(1, GetPK(T, db), "<-") - 1)

                cont = cont & ShowFields(T.Name) & vbCrLf & " primary key " & pk & vbCrLf & vbCrLf
               ''MsgBox ShowFields(T.Name) & vbCrLf & " primary key " & pk & vbCrLf & vbCrLf
            ''End If
        End If
    Next T
    MsgBox cont
    Call createTextFile("C:\createTableStatements.txt", cont)
End Sub
Old July 30th, 2005, 02:36 AM
Friend of Wrox
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts

The problem is probably in the code for createTextFile.

Can you post it?

Access Based Accounting/Business Solutions developer.

Similar Threads
Thread Thread Starter Forum Replies Last Post
web based scanning jayanthg20 ASP.NET 1.0 and 1.1 Basics 1 March 10th, 2009 12:05 PM
Scanning / Finding codes markhorton Classic ASP Databases 0 April 3rd, 2006 02:01 PM
System to order rows a table DB anteojo Classic ASP Databases 1 December 2nd, 2004 02:34 AM
attendance scanning system rajanikrishna Classic ASP Databases 2 June 8th, 2004 04:30 AM
attendance scanning system rajanikrishna Classic ASP Basics 0 June 7th, 2004 10:04 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.