| re: ms access - assigning pk via sql query
Bernie,
A CREATE TABLE statement has to come first. So you probably can't do it in
one SQL statement. And Access/Jet queries don't support multiple SQL
statements in one query object so scripting this is a bit of a pain. But,
basically, create the table then use an INSERT statement to populate it.
"Bernie Yaeger" <berniey@cherwellinc.com> wrote in message
news:34N2c.20672$Ak2.7231575@news4.srv.hcvlny.cv.n et...[color=blue]
> Is there a way in MS Access to assign a PK to a table through a query. I[/color]
am[color=blue]
> creating the table with 'select .... into <tablename> from etc' which[/color]
works[color=blue]
> fine, once executed with executenonquery. But I need to give it a pk as
> well - how can this be done? BTW- I'm working in vb .net, but the query I
> envision would be a simple query in the .mdb itself and I would only[/color]
execute[color=blue]
> it inside vb .net.
>
> Thanks for any help.
>
> Bernie Yaeger
>
>
>[/color] |