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

Generate Scripts

Status
Not open for further replies.

sineados

Programmer
Oct 17, 2001
34
IE
Hi,

I have an access database and I was wondering if its possible to generate the create table scripts so that I can create the database on other machines rather than doing it manually.

If not does anyone know how to create a table with an autonumber using SQL.

thanks in advance,
Sinead
 
Why not do in with VBA. The following code will transfer all existing table structures into another db. Copy the code and paste it into a module and run it by pressing F5.


Sub TransferTableStructure()

Dim tblTable As TableDef
Dim strDestination As String

strDestination = InputBox("Input name of the destination database" & vbCr & "Example: c:\directory\destination.mdb", , CurrentDb.Name)

For Each tblTable In CurrentDb.TableDefs
If Not tblTable.Name Like "msys*" Then
DoCmd.TransferDatabase acExport, "Microsoft Access", strDestination, acTable, tblTable.Name, tblTable.Name, True
End If
Next tblTable

End Sub
 
Or.......

Copy the database without the data onto floppy/shared drive and copy onto the machine??

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top