hello :)

i'm using MS access as a database of my Windows form application.
i'm having problem with create table query, with variable table name. i have tried, but it din't work, as i tried. plz provide an example that can make me understand.

string city = "newyork";

and city should be the name of table in example.

Thanks :)

Recommended Answers

please post the sql that is not working

Jump to Post

All 3 Replies

please post the sql that is not working

heres the query that i have used:

"create table '" + new_city + "' (ID AUTONUMBER, population TEXT, area TEXT)";

try to mention adding primary key constraint aswell.

thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.