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

Creating Access Table error?

Status
Not open for further replies.

JohnStep

Programmer
Apr 19, 2000
190
US
I'm trying to create a table in a Access DB using the following line, but it's giving me a Syntax error. For the life of me I cannot find it.

Any Ideas?


db.Execute "CREATE TABLE Tennant" & "(BuildingName CHAR (50), Apt INT, FirstName CHAR (50), MiddleInitial CHAR(1), LastName CHAR(50), Phone CHAR(20), SSN CHAR (9), PrevAddress CHAR(50), PrevCity CHAR (50), PrevZip CHAR(5), State INT, CarMake CHAR(50), CarModel CHAR (50), CarColor CHAR(50), CarLicense CHAR(25), CarState INT, Employer CHAR(50), EmployerPhone CHAR(20), OtherOccupants CHAR(100), Rent_Due (DATE), Last_Paid (DATE), Next_Due (DATE), Late_Pay (INT), Amount_Paid (CURRENCY), Amount_Due (CURRENCY);"


Thanks in Advaced
 
I thought that 'string' fields in Access are actually Text (not char).

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks alot for the tips. I edited the field to:

DB.Execute "CREATE TABLE Tennant" & "(BuildingName CHAR (50), Apt INT, FirstName CHAR (50), MiddleInitial CHAR(1), LastName CHAR(50), Phone CHAR(20), SSN CHAR (9), PrevAddress MEMO, PrevCity CHAR (50), PrevZip CHAR(5), State INT, CarMake CHAR(50), CarModel CHAR (50), CarColor CHAR(50), CarLicense CHAR(25), CarState INT, Employer CHAR(50), EmployerPhone CHAR(20), OtherOccupants MEMO, RentDue DATE, LastPaid DATE, NextDue DATE, LatePay INT, AmountPaid CURRENCY, AmountDue CURRENCY);"


and it works fine! Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top