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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.