How do I create a table in new database?

kwokv616

Registered User.
Local time
Today, 03:02
Joined
Nov 10, 2008
Messages
46
Dim Sqlstr1, Sqlstr2 As String
Sqlstr1 = "create table Fbal;"
Sqlstr2 = "SELECT IL4010DF.* INTO Fbal FROM IL4010DF ORDER BY IL4010DF.Pnumber;"
DoCmd.RunSQL Sqlstr1
DoCmd.RunSQL Sqlstr2
CurrentDb.TableDefs.Delete "IL4010DF"

Call CreatePKIndexes("Fbal", "Pnumber", "Fund_code")

This creates a table with name "Fbal" in my own database.
How do I create this table in a new database? (I want this done because the file will be very large, more than 1GB)

Thanks!
 
Try changing the statement for Sqlstr2 to something like the following (substitute highlighted text for the actual path):
Code:
Sqlstr2 = "SELECT IL4010DF.*" _
    & " INTO [MS Access;Database=[B][I]C:\MyFolder\MyExternalDatabase.mdb[/I][/B]].Fbal" _
    & " FROM IL4010DF ORDER BY IL4010DF.Pnumber;"

Bear in mind, however, that the CreatePKIndexes function will need to be modified to point to the external database as well.
 
it worked very well thank you very much!
but i now have to deal with the next problem...

how can i do things with the newly created table?
do i link it first? then do everything in the same way?
 

Users who are viewing this thread

Back
Top Bottom