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

Access Idiot seeks help 1

Status
Not open for further replies.

RonRepp

Technical User
Feb 25, 2005
1,031
US
Hi all:

I'm used to doing this stuff in SQL Server, and Access is driving me batty.

I'm simply trying to create a table, but it keeps telling me that the syntax is wrong.

Would someone please show me where?

Code:
Dim dbs As Database
    Dim s As String
    s = "CREATE TABLE Oct08 ([ID] AutoNumber [Long Integer], " & _
        "Keywords Text, CurrentMonth Number [Double], " & _
        "[Annual Monthly Search] Number [Double], [Global Return] Number [Double], " & _
        "[CurrentMonth Return] Number [Double], [Month 1] Text, [Month 2] Text, " & _
        "[Month 3] Text, [Month 4] Text, [Month 5] Text, " & _
        "[Month 6] Text, [Month 7] Text, [Month 8] Text, " & _
        "[Month 9] Text, [Month 10] Text, [Month 11] Text, [Month 12] Text); "
    Set dbs = CurrentDb
    dbs.Execute s

Thanks,

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
place set dbs = currentdb as your first line of code, under you declare (dim) statements).

if your database is sqlserver, you'll need a connection string. post again if you have problems!

-jason
 
Jason:

I do have set dbs=currentDb

It's the 2nd to last line.

The error I'm getting says that there's a problem with the SQL syntax.

Thanks,


Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
Replace this:
([ID] AutoNumber [Long Integer],
with this:
([ID] COUNTER(1,1),

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks.

I knew it was something easy...just not used to Access. Haven't used it in 8 years.

Ron Repp

If gray hair is a sign of wisdom, then I'm a genius.

My newest novel: Wooden Warriors
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top